diff --git a/docs/linux/docker-mailserver.md b/docs/linux/docker-mailserver.md new file mode 100644 index 0000000..42f76c5 --- /dev/null +++ b/docs/linux/docker-mailserver.md @@ -0,0 +1,12 @@ +--- +sidebar_position: 1 +slug: /linux/docker-mailserver +--- + +# Docker Mailserver + +:::info +// TODO: +- install dockercompose +- ... +::: diff --git a/docs/linux/niri/_category_.json b/docs/linux/niri/_category_.json new file mode 100644 index 0000000..c4b0656 --- /dev/null +++ b/docs/linux/niri/_category_.json @@ -0,0 +1,10 @@ +{ + "position": 8, + "label": "Niri Guides", + "collapsible": true, + "collapsed": true, + "link": { + "type": "generated-index", + "description": "Guides all around Niri" + } + } \ No newline at end of file diff --git a/docs/linux/niri/index.md b/docs/linux/niri/index.md new file mode 100644 index 0000000..56cc182 --- /dev/null +++ b/docs/linux/niri/index.md @@ -0,0 +1,6 @@ +--- +sidebar_position: 1 +slug: /linux/niri +--- + +# Overview \ No newline at end of file diff --git a/docs/linux/niri/setup.md b/docs/linux/niri/setup.md new file mode 100644 index 0000000..fd38ea2 --- /dev/null +++ b/docs/linux/niri/setup.md @@ -0,0 +1,6 @@ +--- +sidebar_position: 2 +slug: /linux/niri/setup +--- + +# Setup \ No newline at end of file diff --git a/docs/linux/server-admin/_category_.json b/docs/linux/server-admin/_category_.json new file mode 100644 index 0000000..2be96be --- /dev/null +++ b/docs/linux/server-admin/_category_.json @@ -0,0 +1,10 @@ +{ + "position": 8, + "label": "Server Admin", + "collapsible": true, + "collapsed": true, + "link": { + "type": "generated-index", + "description": "Guides Server Administration" + } + } \ No newline at end of file diff --git a/docs/linux/server-admin/drive-automount.md b/docs/linux/server-admin/drive-automount.md new file mode 100644 index 0000000..bfcad78 --- /dev/null +++ b/docs/linux/server-admin/drive-automount.md @@ -0,0 +1,97 @@ +--- +sidebar_position: 2 +slug: /linux/server-admin/drive-automount +--- + +# Adding an Automount Drive on Linux + +This guide explains how to configure a drive to automount at boot using `/etc/fstab`. + +--- + +## Steps + +### 1. Identify the Drive + +List drives and partitions: + +```bash +lsblk -f +``` + +Find the target partition (e.g., `/dev/sdc1`) and note its UUID: + +```bash +blkid /dev/sdc1 +``` + +### 2. Create a Mount Point + +Choose or create a directory where the drive will mount: + +```bash +sudo mkdir -p /mnt/mydrive +``` + +### 3. Backup `/etc/fstab` + +Always back up before editing: + +```bash +sudo cp /etc/fstab /etc/fstab.bak +``` + +### 4. Edit `/etc/fstab` + +Open `/etc/fstab` with an editor: + +```bash +sudo nano /etc/fstab +``` + +Add a line with the drive's UUID, mount point, filesystem type, and options. Example for ext4: + +``` +UUID=your-uuid-here /mnt/mydrive ext4 defaults 0 2 +``` + +Replace `your-uuid-here` with the actual UUID. + +### 5. Test the Configuration + +Mount all entries without rebooting: + +```bash +sudo mount -a +``` + +Check if the drive is mounted: + +```bash +df -h | grep /mnt/mydrive +``` + +:::danger +If the test fails and you still reboot, the system will drop to emergency mode and manual intervention is required. + +**In that case SSH WON'T WORK** +::: + +### 6. Reboot and Verify + +Reboot the system and confirm the drive automounts: + +```bash +sudo reboot +``` + +After reboot: + +```bash +mount | grep /mnt/mydrive +``` +:::note +- Use `defaults` for standard mount options. +- For other filesystems (e.g., NTFS, FAT32), adjust filesystem type and options accordingly. +- If mounting fails at boot, system may drop to emergency mode; always test with `mount -a` first. +::: \ No newline at end of file diff --git a/docs/linux/server-admin/partition-and-filesystem.md b/docs/linux/server-admin/partition-and-filesystem.md new file mode 100644 index 0000000..c0b727d --- /dev/null +++ b/docs/linux/server-admin/partition-and-filesystem.md @@ -0,0 +1,106 @@ +--- +sidebar_position: 1 +slug: /linux/server-admin/partition-and-filesystem +--- + +# Creating Partition Tables and Filesystems on Linux + +This guide covers creating partition tables and filesystems using command-line tools. + +--- + +## 1. Identify the Disk + +List disks and partitions: + +```bash +lsblk +``` + +Assume the target disk is `/dev/sdc`. + +--- + +## 2. Create a Partition Table with `fdisk` + +Start fdisk: + +```bash +sudo fdisk /dev/sdc +``` + +### Inside `fdisk`: + +- Create a new GPT partition table (recommended for disks >2TB): + +``` +g +``` +- Create a new partition: +``` +n +``` +- Accept defaults for partition number, first sector, and last sector (full disk). + +- Write changes and exit: +``` +w +``` + +--- + +## 3. Format the Partition + +Assuming partition `/dev/sdc1`: + +- Create an ext4 filesystem: + +```bash +sudo mkfs.ext4 /dev/sdc1 +``` + +- For other filesystems: + + - NTFS: `sudo mkfs.ntfs /dev/sdc1` + - FAT32: `sudo mkfs.vfat /dev/sdc1` + +--- + +## 4. Verify the Filesystem + +```bash +sudo blkid /dev/sdc1 +``` + +Check UUID and filesystem type. + +--- + +## 5. Mount the Partition + +Create mount point and mount: + +```bash +sudo mkdir -p /mnt/mydrive +sudo mount /dev/sdc1 /mnt/mydrive +``` + +Verify: + +```bash +df -h | grep /mnt/mydrive +``` + +--- + +## 6. Automount (Optional) + +Follow the **Adding an Automount Drive** guide to configure `/etc/fstab`. + + +:::note +- Creating new partition tables and filesystems will erase data on the disk. +- Backup important data before proceeding. +- Use GPT for disks larger than 2TB; MBR is limited to ~2TB. +- Use `parted` or `gparted` for GUI or more advanced partitioning. +::: \ No newline at end of file