fstab is silent on these partitions:
# Entry for /dev/sdb5 :
UUID=1b82960d-b6bf-4d1a-9328-99a64d68e158 / ext4 defaults,noatime 1 1
# Entry for /dev/sdb1 :
UUID=73c5c092-e2ba-48fe-9725-62db78883871 /home ext4 defaults,noatime 1 2
none /proc proc defaults 0 0
# Entry for /dev/sdb6 :
UUID=f71e5881-0961-48e4-96e4-1c88f3952b43 swap swap defaults 0 0
none /dev/pts devpts defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
While
UUID numbers are an excellent way to get proper partitions mounted with the new kernels that see all drives as
/dev/sd(x), and all partitions as
/dev/sd(xn), I find that
labeling each partition (
which works the same way as UUID numbers) is
easier for me to keep track of what's on each, and for writing mount lines in
/etc/fstab. If one is using any ext formatted partition, the command to label a partition is as follows; (you must do this as
root)
[root@localhost ~]# tune2fs -L <label> /dev/sd<whatever> <Enter>
Replace
<label> with the
name by which the partition will be known, and
<whatever> with the proper
letter and
number for the partition being labeled.
Each label must be
unique for the system being run. No two partitions can have the
same label on the
same machine. Each label I use has a
direct relationship with the
OS installed on it, the
mount point I use, it's intended
purpose, or the
drive it resides on; usually a
number indicating the
drive size. Sometimes it's a
combination. Labels on
ext file systems are limited to
16 characters.
From cfdisk, the labels of the partitions on my 1 TB external drive, on which the MiniMe 2010 installation I'm currently running resides;
Name Flags Part Type FS Type [Label] Size (MB)
----------------------------------------------------------------------------------------------------------------
sdc1 Primary Linux ext3 [boot1000] 320.79
sdc2 Primary Linux swap / Solaris 8291.09
sdc3 Primary Linux ext3 [TR5] 50009.71
sdc5 Logical Linux ext3 [TR5-Documents] 109996.67
sdc6 Logical Linux ext3 [tmpback] 105012.15
sdc7 Logical Linux ext3 [TR6] 32004.57
sdc8 Logical Linux ext3 [mm-master] 32004.57
sdc9 Logical Linux ext3 [mmbuild] 32004.57
sdc10 Logical Linux ext3 [st-backup] 32004.57
sdc11 Logical Linux ext3 [os-backups] 107381.04
sdc12 Logical Linux ext3 [movies2] 322134.87
sdc13 Logical Linux ext3 [openbox] 32012.79
sdc14 Logical Linux ext3 [minime2010] 32498.09
sdc15 Logical Linux ext3 [openbox2] 34365.22
Logical Free Space 70161.64
Cfdisk does
not show
swap partition labels, but the swap partition
was labeled by the
mkswap -L swap1000 /dev/sdc2 command.
My current
/etc/fstab looks like this;
LABEL=minime2010 / ext4 defaults,noatime 1 1
LABEL=TR5-Documents /home/polack/Documents ext3 defaults,noatime 1 2
LABEL=Documents2 /home/polack/Documents2 ext3 defaults,noatime 1 2
LABEL=share7 /share7 ext3 rw,user,auto,exec,noatime 0 0
LABEL=share9 /share9 ext3 rw,user,auto,exec,noatime 0 0
LABEL=movies /movies ext3 rw,user,auto,exec,noatime 0 0
LABEL=movies2 /movies2 ext3 rw,user,auto,exec,noatime 0 0
LABEL=TV-1 /tv ext3 rw,user,auto,exec,noatime 0 0
LABEL=storage00 /zstorage00 ext3 rw,user,noauto,exec,noatime 0 0
LABEL=120backup /zbackup ext3 rw,user,noauto,exec,noatime 0 0
none /proc proc defaults 0 0
# Entry for /dev/sda2 :
LABEL=swap200 swap swap defaults 0 0
# Entry for /dev/sdc2 :
LABEL=swap1000 swap swap defaults 0 0
# Entry for /dev/sde2 :
LABEL=swap750 swap swap defaults 0 0
none /dev/pts devpts mode=0620 0 0
/dev/fd0 /mnt/floppy auto rw,user,noauto,exec 0 0
/dev/sr0 /mnt/cdrom auto ro,user,noauto 0 0
/dev/sr1 /mnt/dvd auto ro,user,noauto 0 0
# none /dev/shm tmpfs defaults 0 0
The command
swapon -s shows all the swap partitions are, indeed, mounted.
[root@littleboy ~]# swapon -sFilename Type Size Used Priority
/dev/sda2 partition 1823368 13704 -1
/dev/sdc2 partition 8096752 0 -2
/dev/sde2 partition 6008300 0 -3
To demonstrate how the labels are used directly with the
mount command, I mount
/dev/sda15, the OpenBox installation below;
[root@littleboy ~]# mount LABEL=openbox2 /mnt/hereIt's the same
format as that of the
first entry of the mount line in fstab, with the mount point I choose, in this case /mnt/here. For each
mount line in
/etc/fstab, the
mount point directory must
actually exist, and these need to be
created as root, except for those that exist in the
users home directory, as in my use of
/home/polack/Documents, and
/home/polack/Documents2.
From there, a look at the
fstab from that installation reveals it is
exactly the
same as my
MiniMe fstab, except for the
/ partition lines. This assures that
whichever installation I boot to, all my
mount points remain the
same, so my data is always in the
same relative position on the running system.
[root@littleboy ~]# cat /mnt/here/etc/fstab# Entry for /dev/sdc15 : <-- This line
LABEL=openbox2 / ext4 defaults,noatime 1 1 <-- and this
LABEL=TR5-Documents /home/polack/Documents ext3 defaults,noatime 1 2
LABEL=Documents2 /home/polack/Documents2 ext3 defaults,noatime 1 2
LABEL=share7 /share7 ext3 rw,user,auto,exec,noatime 0 0
LABEL=share9 /share9 ext3 rw,user,auto,exec,noatime 0 0
LABEL=movies /movies ext3 rw,user,auto,exec,noatime 0 0
LABEL=movies2 /movies2 ext3 rw,user,auto,exec,noatime 0 0
LABEL=TV-1 /tv ext3 rw,user,auto,exec,noatime 0 0
LABEL=storage00 /zstorage00 ext3 rw,user,noauto,exec,noatime 0 0
LABEL=120backup /zbackup ext3 rw,user,noauto,exec,noatime 0 0
none /proc proc defaults 0 0
# Entry for /dev/sda2 :
LABEL=swap200 swap swap defaults 0 0
# Entry for /dev/sdc2 :
LABEL=swap1000 swap swap defaults 0 0
# Entry for /dev/sde2 :
LABEL=swap750 swap swap defaults 0 0
none /dev/pts devpts mode=0620 0 0
/dev/fd0 /mnt/floppy auto rw,user,noauto,exec 0 0
/dev/sr0 /mnt/cdrom auto ro,user,noauto 0 0
/dev/sr1 /mnt/dvd auto ro,user,noauto 0 0
# none /dev/shm tmpfs defaults 0 0
Labels can also be used when needing to run a
file system check, even if one doesn't know/remember the
/dev/sd(xn). If it's a
/ partition, the fsck must be run with the partition
unmounted, so best to be done from the
liveCD. If I wanted to check the file system on my
MiniMe partition, I'd use the command;
[root@localhost ~]# fsck -f LABEL=minime2010 <Enter>