Automatically mount drives on boot

Configuring fstab entry for disks to mount automatically on boot

Terms and Utilities

  • blkid
    • Check LABEL, UUID, PARTUUID from device
  • Create Mount Point
    mkdir /mnt/mp

    Disk Partition tools

    • lsblk
    • blkid
    • fdisk

    Fstab entry

    UUID=<PartitionUUID> /mnt/mp ext4 0 2
    

To create a mount point using fstab, follow these steps:

1. Create the Mount Point:

mkdir /mnt/mp

2. Identify the Partition:

  • Use lsblk to list all partitions on your device:
    lsblk
    
  • Check the block ID for the partition you want to use:
    blkid /dev/sdxN
    
    Replace <partition_id> with the unique identifier from the partition of which you're willing to set up a mount point

3. Set Up Fstab Entry:

  • Create a Fstab entry for your mount point:
    UID=<PartitionUUID> /mnt/mp ext4 0 2
    
    Where:
    • UID is the unique identifier for the partition.
    • /mnt/mp specifies the mount point name and directory structure.
    • ext4 indicates an ext4 partition, which is efficient for performance.
    • 0 sets root as empty, requiring expansion if necessary.
    • 2 expands the root parent if needed.