I know how to map /etc/fstab to the mount point with the device name:

/dev/sdb1        /mnt/home2      ext4    usrjquota=quota.user,jqfmt=vfsv0        0       0

This practice is however highly flawed as it is randomized and can change on reboots, especially when adding and removing disks. Instead, use UUID:

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx       /mnt/home2      ext4    usrjquota=quota.user,jqfmt=vfsv0        0       0

The problem is that I need /dev/sda1 to remain /dev/sda1 and /dev/sdb1 to remain /dev/sdb1 (...etc with many drives) throughout reboots and changing and removing of disks.

Therefore, how can I retain BOTH the device name such as /dev/sda1 AND the mount point such as /mnt/home2 which will never be lost when adding, removing disks or on reboots?

Can both be added via fstab? If not, how to do it?

  • "The problem is that I need /dev/sda1 to remain /dev/sda1" Why? Non-persistent devices do not have consistency across adding hardware and bus rescans. – John Mahowald Mar 27 at 13:15
  • Because I want to, there are reasons but my request is reason enough. – lnx200 Mar 27 at 23:10

Or, label file systems and mount those volumes by LABEL=. Does not uniquely identify an instance of a file system, only its name. Which may be a desired feature, if UUID is not known.

Consider LVM for logical volume names independent of any hardware path, LUN ID, or file system ID.

On Linux, you can create file systems on and mount logical volumes with their /dev/vg/lv devices. The advantage over UUID is that the file system can be reformatted or ID changed, but the same LV remains.

|improve this answer|||||
  • I meant to use it using the existing filesystem, not to create LVMs. – lnx200 Mar 27 at 23:10
  • Then use a file system UUID or LABEL (I forgot label). /dev/sdb1 is a non-persistent device name, Red Hat calls it such in their documentation. – John Mahowald Mar 27 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.