First, you need to be sure your disks are labeled. For ext[23], the command is 'e2label -L /dev/...' where ... would be sda4 or hdb2, or whatever else you have. For xfs, the command is 'xfs_admin -l /dev/...'
If you have a disk with no label, you would need to add one. The disks must be unmounted before you can make changes, so you'd need to boot from a CD as the quickest, easiest way to work with them. For ext[23], the command is 'e2label -L label', for xfs it's 'xfs_admin -L label', where 'label' is any name you choose, within the size limits specified in the man page for the commands. Note the lower/upper case option with the xfs command.
All recent Debian installs that I've done have created labels for the devices created during the install. These are the name of the mount point. So, if you have a disk that is mounted on '/var' (as you do), the default label will be '/var'.
The only issue I have with this is the label chosen for the 'root' device. This is '/', which is not a legal name in the file system, so no link is made for the root device, to use with the mount command. I changed the root label on my system from '/' to '/root', so a valid link is created.
Now that you have labels on all your disk drives, change the two files like this:
menu.lst: from kernel /boot/vmlinuz-2.6.17-2-amd64 root=/dev/sda1 ro to kernel /boot/vmlinuz-2.6.17-2-amd64 root=LABEL=/root ro fstab (just one example, the rest are similar): from /dev/sdb1 /var ext3 defaults 0 2 to LABEL=/var /var ext3 defaults 0 2 Reboot. Bob Joost Kraaijeveld wrote:
Hi, After an update of my kernel to 2.6.17 my machine only boots at random. I have googled for a solution and it appears that it happens because of the way the harddisks are found during startup . The solution described involves using lables in fstab and grub (menu.lst). But whatever I do, I cannot find a way to add labels in my fstab an grub that actually work. Can anyone tell me what I have to do to make my machine boot reliable using labels with fstab/grub? I have tried to add labels to both fstab and menu.lst but a reboot failed miserably.... Excerpt from my menu.lst title Debian GNU/Linux, kernel 2.6.17-2-amd64 root (hd0,0) kernel /boot/vmlinuz-2.6.17-2-amd64 root=/dev/sda1 ro initrd /boot/initrd.img-2.6.17-2-amd64 savedefault My fstab:# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/sda1 / ext3 defaults,errors=remount-ro 0 1 /dev/sdb1 /var ext3 defaults 0 2 /dev/sdc1 /home xfs defaults 0 2 /dev/sdc2 /pgdata xfs defaults 0 2 /dev/sda5 none swap sw 0 0 /dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/fd0 /media/floppy0 auto rw,user,noauto 0 0TIA
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature