/config/mount.sh problems

Having given up on my last problem, I did a clean reinstall from scratch.

This time, instead of using clonezilla, I used partimage manually. (I also imaged the entire boot track (63 sectors), instead of just the MBR, in order to pick up all the nice grub pieces.)

So far, so good.

Now I want to test my backup, so a swap hard drives, restore the boot track (which includes the MBR and partition table), and use partimage to restore all of my partitions.

Now the weird stuff starts happening.

When booting, it brings up the initial menu OK, I pick the normal Linux boot, and then (if I hit escape to watch whats happening as it boots) things hang up with:

waiting for device /dev/disk/by-id/scsi-SATA_WDC_WD2500BEVE-_WD-WXEZ07164872-part3 to appear…

When it gives up waiting, I’m in a very minimalist shell. Since my root partition didn’t load, I’m guessing that this is from initrd?

In any case, I look around and find a /config directory with several files. The problematic ones are:

mount.sh

 "$rootdev" ] || rootdev='/dev/disk/by-id/scsi-SATA_WDC_WD2500BEVE-_WD-WXEZ07164872-part3'
 "$rootfsck" ] || rootfsck='/sbin/fsck.ext3'

and also

storage.sh

 "$fallback_rootdev" ] || fallback_rootdev='/dev/disk/by-id/scsi-SATA_WDC_WD2500BEVE-_WD-WXEZ07164872-part3'
 "$rootdev" ] || rootdev='/dev/disk/by-id/scsi-SATA_WDC_WD2500BEVE-_WD-WXEZ07164872-part3'
 "$resumedev" ] || resumedev='/dev/sda2'

I mount my root partition in order to be able to edit these files, but it’s a waste of time because the next time I boot they’re back as they were.

Does anyone have any idea where these files live, and if it is possible to edit them so that they stay edited?

Otherwise, my current backup solution is only useful as long as my current hard drive doesn’t die. And it is useless for imaging a series of essentially identical machines for the same reason.

Or do I have to reinstall from scratch yet again and make sure the partitioning doesn’t mount by disk id?

Thanks!

S.

On Mon, 25 Aug 2008 06:26:02 GMT
sylerner <sylerner@no-mx.forums.opensuse.org> wrote:

> When booting, it brings up the initial menu OK, I pick the normal Linux
> boot, and then (if I hit escape to watch whats happening as it boots)
> things hang up with:
>
> -waiting for device
> /dev/disk/by-id/scsi-SATA_WDC_WD2500BEVE-_WD-WXEZ07164872-part3 to
> appear…-

> Otherwise, my current backup solution is only useful as long as my
> current hard drive doesn’t die. And it is useless for imaging a series
> of essentially identical machines for the same reason.
>
> Or do I have to reinstall from scratch yet again and make sure the
> partitioning doesn’t mount by disk id?

Kinda answered that one yourself.

You could change all those ‘/dev/disk/by-id/scsi…’ with ‘/dev/sda3’ (for
-part3) as appropriate. But that doesn’t cover if it gets put into a box
with an IDE drive which might be ‘before’ it.

I use the ‘label’ method, and find it very handy, since I have seven external
drives, and depending on which ones feel frisky, scrambles the whole
‘sda/sdb/sdc’ kind of one-to-one matching.

if, when you format a drive using the openSUSE installer, go to the ‘fstab’
options, choose ‘label’ in the upper section, then put a meaningful name in
the ‘label’ field. I name my swap, root and home partitions thusly… and
therefore, in ‘/etc/fstab’, they’re identified as ‘LABEL=swap’ and
‘LABEL=root’…

To format them by hand and add a label…

mkfs.ext3 -j -L root /dev/sdb2

would create an ext3 filesystem on /dev/sdb2 with the label of ‘root’.
(I always add ‘-m 1’ since drives are large nowadays, see the man page)

mkfs.vfat -n myname -F32 /dev/sdg2

would create a FAT32 filesystem on sdg2, label of ‘myname’

mkfs.reiserfs -l myname /dev/sdg2

same for reiserfs.

You can add labels to existing partitions too:

For ext2/ext3:

tune2fs -L myname /dev/sdg2

(change as appropriate, of course)

For reiserfs:

reiserfstune -l myname /dev/sdg2

This causes the system to LOOK for the drive requested, regardless of where
(or when) it is connected to the system.

My root partition (on the first SATA internal drive) is mounted properly
regardless if I add another PATA/ide drive to the system, which would
technically bump it up another notch. (sdc vs sdb etc)

Shouldn’t have to reformat/reinstall to make this work though, unless you
just want the practice.

Even grub can play:

kernel root=LABEL=root resume=LABEL=swap …

works quite well.

Loni


L R Nix
lornix@lornix.com

Thanks for nailing down what I should have done (and will do in future installations). It sounds like we should encourage them to change label to being the default.

In an attempt to salvage my current installation, as well as to satisfy my curiosity, I’m wondering if there is any way to permanently edit these files that are causing me trouble.

Are they (as well as a bunch of number-prefixed shell files in the /boot directory) from initrd, or are they being fed in from elsewhere?

And if they are indeed from initrd, is there any way to open it up and edit its contents, or is it a sealed box once the system has been set up?

Thanks again for some excellent pointers. If nothing else, they should be copied to the newbie FAQ to save others from having as much fun as I have had the last several days! lol!

S.

On Mon, 25 Aug 2008 09:16:02 GMT
sylerner <sylerner@no-mx.forums.opensuse.org> wrote:

>
> Thanks for nailing down what I should have done (and will do in future
> installations). It sounds like we should encourage them to change label
> to being the default.
>
> In an attempt to salvage my current installation, as well as to satisfy
> my curiosity, I’m wondering if there is any way to permanently edit
> these files that are causing me trouble.
>
> Are they (as well as a bunch of number-prefixed shell files in the
> /boot directory) from initrd, or are they being fed in from elsewhere?
>
> And if they are indeed from initrd, is there any way to open it up and
> edit its contents, or is it a sealed box once the system has been set
> up?
>
> Thanks again for some excellent pointers. If nothing else, they should
> be copied to the newbie FAQ to save others from having as much fun as I
> have had the last several days! lol!
>
> S.
>
>

But think how much you’ve learned! AND… think how much you’ll retain!
Just posting it usually doesn’t help people retain information… I imagine
you won’t forget this for a long, long time! {Grin}

If you use a rescue disk, you can change those as needed. I would recommend
using the tune2fs/reiserfstune commands to NAME each drive. Then, edit the
various files and instead of /dev/disk/by-id/… put LABEL=disk4 or whatever.

For the various files:

===mount.sh:
You’re dealing with the Western Digital 250Gig, partition 3. (rootdev)

===storage.sh:
WD 250Gig, partition 3 again

so, if the Western Digital is currently /dev/sda:

tune2fs -L root /dev/sda3
(you might also name the swap partition, use the mkswap -L swap /dev/xxx cmd)

and edit (on the western digital, partition 3, you’ll have to mount it, and
all files are from that mount point…)

===boot/grub/menu.lst:
change root=/dev/… to root=Label=root
change resume=/dev/… to resume=Label=swap

===etc/fstab:
change /dev/disk/… to Label=root for the ‘/’ mount line
change /dev/disk/… to Label=swap for the ‘swap’ mount line

That should get your system back up and running.

No, most of the issues come from the grub command line (boot/grub/menu.lst)
and the fstab entries (etc/fstab).

{Sigh} although you might want to rebuild it (again!) and use the labels for
root/swap/home etc from the start.

You can create a swap partition by using the same ‘fstab’ entry options in
the formatter too. (otherwise, see mkswap man page)

Loni


L R Nix
lornix@lornix.com

The only problem is when I edit these files, they don’t stay edited!

My best guess is that they are being set up either by grub or initrd. However, you may be right in that the information used to generate these files may be read in from the menu.lst file and not embedded in some other odd place.

I’m afraid I’m off for two weeks of vacation in a few hours, so verification will have to wait until I return, but I have definitely learned a few important lessons from this whole experience.

  1. If at all possible, avoid use of extended partitions. At the very least keep Linux in primary partitions and let anything left over go in the extended partitions.
  2. Label all partitions and make sure they are mounted by label, not by ID.
  3. If there is any way in the world to avoid it, don’t ever again set up a machine whose BIOS is not fully in synch with the capabilities of the hardware
    . (E.g.: not able to properly recognize disk geometry, etc.)

Thanks again for all the help and useful pointers. I’ll post a follow-up when I get back as to whether updating the menu.lst fixes this problem.

Best regards,

S.