Re: Debian AMD64 boots only at random: how to use labels/fstab/grub



I'm only familiar with the ext[23]/xfs filesystem commands which is what you appear to be using. Other FS's have similar tools, I expect.

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 0


TIA


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



Relevant Pages

  • Re: Will this HD swapping work OK? What to beware of?
    ... mount partitions by label. ... If it uses the first form, ... Check its fstab, too. ... new disk and/or edit fstab to refer to /dev entries instead. ...
    (comp.os.linux.misc)
  • Re: Will this HD swapping work OK? What to beware of?
    ... mount partitions by label. ... If it uses the first form, ... Check its fstab, too. ... new disk and/or edit fstab to refer to /dev entries instead. ...
    (comp.os.linux.hardware)
  • Ribbon X Question
    ... I have managed to put together a pretty simple customization for the Ribbon ... these commands come with their own default labels. ... I settled on label=" " which works without error but I was ...
    (microsoft.public.office.developer.vba)
  • Re: sed - add thousand separator
    ... in a one-liner - not a script. ... Label for b and t commands. ... If a s/// has done a successful substitution since the last input line was read and since the last t command, then branch to label; if label is omitted, branch to end of script. ...
    (comp.unix.shell)
  • Re: Labels - what command to use to go to next label?
    ... Base article on how to get Word to loop through records until ... > label, and when it reaches the condition that makes it not ... > then else, nesting 12 commands, but it's not clear to me ... This reply is posted in the Newsgroup; ...
    (microsoft.public.word.mailmerge.fields)