LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Installed more storage and now I can't boot (https://www.linuxquestions.org/questions/debian-26/installed-more-storage-and-now-i-cant-boot-751161/)

SibLiant 08-29-2009 05:56 PM

Installed more storage and now I can't boot
 
Hi community,

I've been trying to convert to Debian (lenny) for my primary desktop for the last month. I'm making some progress accept for this little setback.

My working config consisted of my primary WD 1TB (sda) drive with grub installed. the first partition was windows. The others were linux. A second 1TB HD formated in NTFS

I needed some more storage space so I bought an eSata controller which has an external eSata port and an internal Sata port. I've installed two 1 TB drives into the system (1 esata and 1 internal) and tried to boot. NEGATIVE :(

I get dumped to a initrmfs prompt. cd into /dev and run
ls -l | grep sd

sda
sda1
sdb
sdb1
sdc
sdc1
sdc2
sdc3

... at this point it's clear that my new drives have commandeered my previous assignments. So I reboot and in Grub I just point the kernal image to sdc2. I see a few console errors fly by but gnome comes up. i log in and i'm greeted with errors about /home and I can't actually log in. it's pretty clear that this new drive assignment is screwing me. So i figured i would put my Lenny dvd in and boot into that and see what I can find. I'm now in recovery mode. I look at my drive assignments and low and behold it's seeing sda1, sda2, sda3, sda4, sda5.

I'm afraid to do anything drastic at this point. Why do my new drives seem to be screwing my system?

/weeps

karamarisan 08-29-2009 07:08 PM

As you've learned, device files are not guaranteed to be consistent. I've actually seen some problems where they change boot-to-boot, so at least you don't have to deal with that, eh? :)

The bit about seeing three disks with five partitions among them vs. one with five on it doesn't really make sense. Before anything else, have you tried just removing the new drives and seeing if you can boot like that?

tommylovell 08-29-2009 09:13 PM

My guess is that when you booted off sdc2, the reason you were missing your /home directory (and probably more), was the result of having hardcoded devices in /etc/fstab like

Code:

/dev/sda_      /home      ext3    ...
What was once /dev/sda_ is now /dev/sdc_ and the mount is failing.

An alternative to using explicit partition devices is to use the UUID of the partition that you want to mount; or (if the partitions are ext2/3) use LABEL=.

I know it's obvious but is there a way in the bios to reestablish the original boot order? Does the esata cards bios have an option, or the motherboard have an option? (I'm particularly ignorant in these matters, so this may be a worthless avenue to pursue...)

Or remove the new drives, change /etc/fstab so that it has no hardcoded partitions in it (ala UUID= or LABEL=), and go from there.

If on removing the new dries the system won't boot, boot off the sdc2 partition as you did earlier, and alter /etc/fstab to correct any entries (ie. make the /dev/sdc_), and see if the system will boot.

I have a boot partition (/dev/sda1) and an LVM partition (/dev/sda2) on my system.

The boot partition entry in /etc/fstab looks like this.

Code:

UUID=97bcf411-5558-4cf9-9aef-5108fa686246 /boot ext3    defaults        1 2
instead of
Code:

/dev/sda1                  /boot    ext3    defaults    1 2
I don't know Debian. Perhaps some Debian folks can comment on whether 'vol_id' is available on your system to find the UUID of your partitions.

Code:

[root@athlonz ~]# locate vol_id
/lib/udev/vol_id
/usr/share/man/man8/vol_id.8.gz
[root@athlonz ~]# /lib/udev/vol_id --uuid /dev/sda1
97bcf411-5558-4cf9-9aef-5108fa686246
[root@athlonz ~]#

If you have ext2/3 file systems, LABEL might be easier to use. Here's an example of doing the 'boot' partition. You'd need to do each Linux partition in /etc/fstab.

Label the partition.
Code:

[root@athlonz ~]# e2label /dev/sda1 boot
Check that it's labeled correctly.
Code:

[root@athlonz ~]# e2label /dev/sda1
boot

Change /etc/fstab to use labels like this.
Code:

LABEL=boot                /boot    ext3    defaults    1 2
Whatever you decide to do, good luck.

Note that the /etc/fstab entries here are off of a Fedora system. Debian seems to have a slightly different format. Debian folks: some help here!

syg00 08-29-2009 10:27 PM

Code:

ls -l /dev/disk/by-uuid/
ls -l /dev/disk/by-label/

If you want to use either in the boot-loader, the initrd must have logic in it to resolve the uuid or label prior to switching the root.

SibLiant 08-30-2009 10:53 AM

pure AWESOMENESS!

I'm back up and all drives are functional. Special thanks to tommylovell. That level of description was fantastic. I snatched the uuid from ls -l /dev/disk/by-uui (thanks syg00!), modified my fstab to mount the uuid's. modified /boot/grub/menu.lst and pointed my kernel image to the correct serial device.

I love you guys!

/weeps again


All times are GMT -5. The time now is 11:10 PM.