5

I've had this linux machine running for a few years now, no problems etc. Very happy.

Last night I did some updates and when I booted up this morning my dual screens were screwy so I updated the Nvidea driver with

NVIDIA-Linux-x86_64-295.49.run

the machine is running

Linux workstation.localdomain 2.6.32-220.13.1.el6.x86_64 #1 SMP Tue Apr 17 23:56:34 BST 2012 x86_64 x86_64 x86_64 GNU/Linux

The above is the only significant change.

I have an additional hard drive that mounts to /mnt/1TB

cat /etc/fstab

/dev/mapper/vg_workstation-lv_root /                       ext2    defaults        1 1
UUID=57473c69-4e82-450e-a0a2-9db51d10288c /boot                   ext2    defaults        1 2
/dev/mapper/vg_workstation-lv_home /home                   ext2    defaults,user_xattr        1 2
/dev/mapper/vg_workstation-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sde1       /mnt/1TB        ext2    defaults    0 0

This fstab like the machine has been stable, not changed for some time but now each time the machine boots it changes is dev name for example sometimes it's found at /dev/sda1 and sometimes at /dev/sde1 ?? Weird?

I am able to manually mount the drive i.e. mount /dev/sda1 /mnt/1TB/ and the data is all there and usable but I would rather have the fstab mount it than me. What's gone wrong? What's got corrupted?

Thanks

cjc
  • 24,533
  • 2
  • 49
  • 69
Andrew
  • 389
  • 1
  • 8

1 Answers1

10

If your BIOS is detecting devices in a different order you can mount by label or by UUID. (You can see your /boot mount is already doing this.)

LABEL=filesystemlabel         /mnt/directory      type     options

-or-

UUID=uuidhere                 /mnt/directory      type     options

You can get the UUID with the blkid command or the label with e2label. (Assuming ext2/ext3.) If it has no label, you can set it e2label also, or tune2fs.

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
  • Aren't CentOS partitions defined by label (and now UUID) by default? – ewwhite May 09 '12 at 00:36
  • Every device does have a UUID but your filesystem doesn't *have* to have a label. It depends on if one was given when you `mkfs`'d. Still, the `/etc/fstab` entry can be created however you want. – Aaron Copley May 09 '12 at 14:35