Mounting additional partitions


Lately I've had trouble with partitions mounting automatically. This is on a desktop with three hard disks, one of which is SATA. To eliminate the issue I've changed the way that they are mounted. Instead of using, for example

/dev/sda1 /media/sata500 ntfs-g3 defaults 0 0

I now use the UUID of the disk, for example, on an Arch system

/dev/disk/by-uuid/BC7035C1703582E6      /media/sata500  ntfs-3g defaults        0 0

To find out what the UUID of a particular partition is issue blkid.

[glenn@archdesk ~]$ sudo blkid
/dev/sdc1: LABEL="/" UUID="cc000ff7-1149-4a5a-821a-677a1817cf58" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sda1: UUID="BC7035C1703582E6" LABEL="SATA500GB" TYPE="ntfs" 
/dev/sdb1: UUID="A418DDF518DDC708" TYPE="ntfs" 
/dev/sdb2: UUID="a787af77-983d-4076-b9e6-8012f66bc83b" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdb3: UUID="9be07193-9295-4127-abd2-eb67dab2f987" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdb5: LABEL="/1" UUID="029443a2-2a5a-4237-854e-2dd0e2d28182" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdb6: LABEL="Swap" UUID="e63e59b9-18e5-4591-ac8d-e2174515f3be" TYPE="swap" 
/dev/sdc2: UUID="f256a0bb-58cc-4598-9997-512789dfe130" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdc3: UUID="a2cd773f-318f-4885-a001-76a8d13f1fc1" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdc5: UUID="5b24dd6e-3aac-4c4d-9beb-3d10844da45a" TYPE="ext3" 
/dev/sdc6: UUID="3482f861-6778-4402-87ac-c0b1d5551485" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdc7: UUID="f41970c9-9a2e-4263-a1d3-e840820b8a0e" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdc8: UUID="a90bdcb6-4328-45f1-9201-b315260a6c59" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdc9: UUID="0be24930-b6e9-441b-a905-165cd734015f" SEC_TYPE="ext2" TYPE="ext3" 

This list clearly shows that the UUID of /dev/sda1 is BC7035C1703582E6.

This method can be used on any Linux system that uses UUID. It appears that this is a far better method than calling out the partitions using the /dev/sdx method. In a nutshell, if you want to mount a particular partition you first need the UUID of that partition. Then you need to make a mount point, somewhere to mount the partition to.

sudo mkdir /media/disk

Now add a line to the file /etc/fstab, like so.

UUID=0be24930-b6e9-441b-a905-165cd734015f /media/disk ext3 defaults 0 0

Now type

sudo mount -a

The partition will be mounted immediately and will be mounted every time you reboot.


Return home

Mounting additional partitions (last edited 2009-10-18 19:35:28 by GlennJohnson)