You are not logged in.

#1 2011-05-08 17:17:13

Ideka
Member
Registered: 2011-01-19
Posts: 15

[SOLVED] Booting from external HDD

I'm trying to boot my current Arch installation from an external HDD.
First I used dd to copy the entire drive over. That seemed to work fine.
Then I modified the /boot/grub/menu.lst file (in the external HDD):

# (0) Arch Linux
title  External Arch Linux
root   (hd1,1)
kernel /boot/vmlinuz26 root=/dev/sdb2 ro
initrd /boot/kernel26.img

# (1) Arch Linux
title  External Arch Linux Fallback                                             
root   (hd1,1)
kernel /boot/vmlinuz26 root=/dev/sdb2 ro
initrd /boot/kernel26-fallback.img

(These are the last lines only.)

I select the external HDD in the boot menu, and the GRUB menu shows up displaying "External Arch Linux" and "External Arch Linux Fallback", so as far as that goes, everything seems to work. But after choosing either option, the computer complains saying it can't find /dev/sdb.
I don't know what to do. I tried playing a bit with /boot/grub/menu.lst and /etc/fstab (both in the external HDD), but nothing worked.

By the way, in both disks,
sdx1 is /home
sdx2 is /
sdx5 is swap


Also, I wasn't sure which subforum was appropiate for this question.

Last edited by Ideka (2011-05-08 19:58:54)

Offline

#2 2011-05-08 17:42:18

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED] Booting from external HDD

Try to use UUIDs in the kernel lines. Maybe you have another device plugged in which has assumed the sdb nomenclature.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-05-08 17:43:19

twilight0
Member
From: Greece
Registered: 2011-05-01
Posts: 227
Website

Re: [SOLVED] Booting from external HDD


Proud Arch Linux user since 2007.

Offline

#4 2011-05-08 18:51:37

Ideka
Member
Registered: 2011-01-19
Posts: 15

Re: [SOLVED] Booting from external HDD

@twilight0: Thanks, but I looked at that already.

@Inxisible: I tried this:

# (0) Arch Linux                                                                
title  External Arch Linux
root   (hd1,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/0d4278e6-aab4-4f11-a886-d7680f9f6ef2 ro
initrd /boot/kernel26.img

# (1) Arch Linux
title  External Arch Linux Fallback
root   (hd1,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/0d4278e6-aab4-4f11-a886-d7680f9f6ef2 ro
initrd /boot/kernel26-fallback.img

and, in fstab:

UUID=52a5e06a-6b27-4680-a2f6-888c0afc5c73  /home   ext4    defaults        0       1
UUID=0d4278e6-aab4-4f11-a886-d7680f9f6ef2  /       ext4    defaults        0       1
UUID=d322e480-7e39-4f14-a95a-217a22ffa550  swap    swap    defaults        0       0

It boots fine but it mounts the internal HDD. hmm
Anyway, I randomly ran blkid and... holy crap!

# blkid
/dev/sda1: UUID="52a5e06a-6b27-4680-a2f6-888c0afc5c73" TYPE="ext4" 
/dev/sda2: UUID="0d4278e6-aab4-4f11-a886-d7680f9f6ef2" TYPE="ext4" 
/dev/sda5: UUID="d322e480-7e39-4f14-a95a-217a22ffa550" TYPE="swap" 
/dev/sdb1: UUID="52a5e06a-6b27-4680-a2f6-888c0afc5c73" TYPE="ext4" 
/dev/sdb2: UUID="0d4278e6-aab4-4f11-a886-d7680f9f6ef2" TYPE="ext4" 
/dev/sdb5: UUID="d322e480-7e39-4f14-a95a-217a22ffa550" TYPE="swap"

It seems that, as I used dd to copy the disk, everything was copied, including the UUIDs. Wow.
So... I guess I'll have to look for a way to regenerate the UUID...

EDIT: OK, found it:

# uuidgen | xargs tune2fs /dev/sdaX -U

Now when I boot I get the same not found error as before.
And if I change root to (hd0,1), I get a kernel panic: "kernel panic: No init found. try passing init = option to kernel".

Last edited by Ideka (2011-05-08 19:58:22)

Offline

#5 2011-05-08 19:48:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Booting from external HDD

Did you complete this step?

Wiki article wrote:

Regenerate the initrd image, kernel26.img. Edit /etc/mkinitcpio.conf, changing the hooks to include (at a minimum): "base udev usb ide filesystems"


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2011-05-08 19:56:00

Ideka
Member
Registered: 2011-01-19
Posts: 15

Re: [SOLVED] Booting from external HDD

jasonwryan wrote:

Did you complete this step?

Wiki article wrote:

Regenerate the initrd image, kernel26.img. Edit /etc/mkinitcpio.conf, changing the hooks to include (at a minimum): "base udev usb ide filesystems"

Actually, yes.
After adding usb to mkinitcpio.conf, I tried this:

# chroot /media/extenal-HDD
...
# pacman -S kernel26

and this too:

# pacman -S kernel26 --root=/media/external-HDD

In both cases, a lot of errors (access to /dev/null denied) showed up, but mkinitcpio still reported "SUCCESS", so I just ignored the errors.

But I suspected that might be the problem, so I added usb to /etc/mkinitcpio.conf in the internal HDD and ran:

# pacman -S kernel26
...
# cp -R /boot/ /media/external-HDD/

Now it works smile.

Thanks everyone!

Offline

Board footer

Powered by FluxBB