You are not logged in.

#1 2011-10-25 13:05:56

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Can an existing Arch system boot on a different machine via USB?

My notebook where my Arch system was running broke down. Now I wonder if I could boot it on my desktop PC using an USB Adapter for the notebook harddrive.

I already tried it, but got only so far to see that the kernel can't find the root filesystem.
I guess I have to do something to let USB mass storage be initialized early enough on the boot. How do I do that exactly? Is it enough to put USB into HOOKS and rebuild the init ramdisk?
And I guess I have to address the root partition properly. How? By using the filesystem ID?
Anything else to consider when booting Arch from USB?

Offline

#2 2011-10-25 13:30:11

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: Can an existing Arch system boot on a different machine via USB?

Offline

#3 2011-10-26 07:56:42

ChojinDSL
Member
From: Germany
Registered: 2010-11-30
Posts: 64
Website

Re: Can an existing Arch system boot on a different machine via USB?

I'm guessing your netbook was 32bit. As such you should be able to boot it up on other PCs without too much hassle.

I have a complete Arch Installation which I run via a USB key.

That being said, if your grub and fstab config refers to your partitions as /dev/sda or such, then obviously that layout can change depending on which computer your on.

Your best bet ist to use UUIDs which you can setup during the arch install, or implement retroactively. I think the wiki should provide you with enough info on that.

Also, don't forget that you will probably need to rebuild your initrd modules for your kernels. Pay attention to any hooks you might need to activate.

The HOOKS line in my mkinitcpio.conf looks like this:
HOOKS="base udev usb pata scsi sata lvm2 encrypt filesystems usbinput"

Notice how the usb hook is one of the first ones, even before pata scsi and sata.

Offline

#4 2011-10-26 13:04:27

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

Thanks so far.
HOOKS seem to work for now. But the persistent block device naming doesn't. I tried it by-label, because I find it more flexible. Next I will try by-uuid.

Yes, my broken notebook is a Centrino (Pentium M) and my desktop is a Core 2 Duo.
I removed the harddisk from the notebook and used an USB Adapter to connect it to my desktop.

Offline

#5 2011-10-29 13:13:29

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

Well, persistent block device naming doesn't work on boot. "UUID=..." in fstab works when the initscripts mount the filesystems. I can boot when I guess the correct partition as root device.
What prerequisites are needed for persistent block device naming to work when booting with legacy grub from an USB disk?

I am not sure, if the USB hook is run early enough. It is not printed out, when the "root device ... doesn't exist" message comes. Should I put it before UDEV in mkinitcpio.conf??

Also, I get an "HDIO_GET_IDENTITY failed" of the USB disk. This could be caused by the USB adapter.

Offline

#6 2011-11-05 13:20:50

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

The wikipage says I have to check for klibc-udev >= 101-3, but the klibc packages are gone. What replaced them? How does boot work in arch at the moment??
EDIT: Ok, I found out that klibc was replaced by busybox. So, how do I get persistent block device naming to work on a busybox based early userspace?

No matter whether I put hook "usb" before or after hook "udev", it is executed after if at all!??

Can I configure xorg to work for different video cards and display resolutions with one configuration? Is there an usable autodetect mode or something similar?

Last edited by cro (2011-11-05 13:35:12)

Offline

#7 2011-11-05 16:27:40

tydell
Member
From: actually: Hannover, DE
Registered: 2009-07-26
Posts: 109
Website

Re: Can an existing Arch system boot on a different machine via USB?

cro wrote:

The wikipage says I have to check for klibc-udev >= 101-3, but the klibc packages are gone. What replaced them? How does boot work in arch at the moment??
EDIT: Ok, I found out that klibc was replaced by busybox. So, how do I get persistent block device naming to work on a busybox based early userspace?

No matter whether I put hook "usb" before or after hook "udev", it is executed after if at all!??

I have done something like you trying to do a month ago. My laptop broke down, south bridge died so I need to buy new laptop. But I also wanted to use my system from laptop so I got chassis for external drive and I made my laptop hdd as external usb hdd, which I can boot on desktop from usb.
I had usb after udev in HOOKS and also there was autodetect. Then i could boot my arch system from external HDD. It looked like this:

HOOKS="base udev usb autodetect pata scsi sata filesystems"

When I get into grub I also had to change boot options. I have Sata HDD in my desktop pc, it was detected as sda1. My external HDD (plugged to USB at the front panel of my desktop) was detected as sda2.
Because there was grub on my external HDD with boot options from my laptop, I had to change manually sda1 to sda2 in boot options in grub. Then my arch booted from external usb hdd (which is my laptop hdd).

Can I configure xorg to work for different video cards and display resolutions with one configuration? Is there an usable autodetect mode or something similar?

You need to install drivers for other video cards and do not use xorg.conf. Then your Arch will be using right video driver automatically.

Offline

#8 2011-11-05 20:55:55

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

Thanks for your answer.

tydell wrote:

I have done something like you trying to do a month ago. My laptop broke down, south bridge died so I need to buy new laptop. But I also wanted to use my system from laptop so I got chassis for external drive and I made my laptop hdd as external usb hdd, which I can boot on desktop from usb.
I had usb after udev in HOOKS and also there was autodetect. Then i could boot my arch system from external HDD. It looked like this:

HOOKS="base udev usb autodetect pata scsi sata filesystems"

yes, I have the same configuration. I see no output of the usb hook while booting.

tydell wrote:

When I get into grub I also had to change boot options. I have Sata HDD in my desktop pc, it was detected as sda1. My external HDD (plugged to USB at the front panel of my desktop) was detected as sda2.
Because there was grub on my external HDD with boot options from my laptop, I had to change manually sda1 to sda2 in boot options in grub. Then my arch booted from external usb hdd (which is my laptop hdd).

When I guess the correct partition as root device, mostly /dev/sdc5, I can boot. But it doesn't work when using persistent block device naming, for example by UUID or by label, although the wiki says it should work.

tydell wrote:

Can I configure xorg to work for different video cards and display resolutions with one configuration? Is there an usable autodetect mode or something similar?

You need to install drivers for other video cards and do not use xorg.conf. Then your Arch will be using right video driver automatically.

ok, thx, I'll try that. I suspected something like that. But how can I configure xorg without using xorg.conf, when I am not satisfied with autodetected and default settings?

Offline

#9 2011-11-06 20:14:50

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

Odd thing is, in the recovery shell opening right after the "root device not found" message, I can see /dev/disk/by-label/archroot, also by executing blkid. When I then type "exit" to continue trying to boot, it still can't find the root device, pointing out that it doesn't recognize the filesystem type (it is an ext3) and I should add "rootfstype=..." to my kernel command line. If I do that it doesn't work either.
EDIT: Ok, I got it working by label, found a stupid typo. big_smile But it doesn't work with the LABEL=... and UUID=... syntax. Also, I had a weird behavior in the recovery shell. When I first type "mount /dev/disk/by-label/archroot /new_root" I get an "file not found", when I then type "mount -t ext3 /dev/disk/by-label/archroot /new_root" it works, the partition is mounted.
What is going wrong?

Besides all that, I have a problem that chainloading Windows 7 from the legacy Grub from the usb disk, doesn't work. Windows 7 crashes and restarts the machine. A short internet search gives me the impression that there is a general problem with Grub and Win7.

EDIT: Also Xorg seems to work with autodetect for now. But how can I adjust settings without using xorg.conf?

Last edited by cro (2011-11-06 21:58:40)

Offline

#10 2011-11-30 15:29:26

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

Strange, after last updates it stopped working again. What changed? I didn't change a thing.
Now I get the "Error: unable to determine major/minor number of root device" if I try it by "root=/dev/disk/by-label/archroot" or by "root=/dev/disk/by-uuid/..." and even if I guess the correct partition "root=/dev/sdc5". The latter always worked before. What is wrong now?
In the Recovery shell I can see and mount all three alternatives. Why doesn't it boot through?

Offline

#11 2011-12-01 03:24:05

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

Booting with lts-kernel works but barely usable because it doesn't support my nvidia card and my display. For the moment I'm stuck with kernel 2.6.32 and a X11 resolution of 1280x1024 stretched to 1920x1080. sad
I suspected that it's a kernel issue. I reverted back to kernel 3.1.2 (EDIT: from 3.1.3) but that didn't help. I would revert back to kernel 3.1 or 3.0.X but I don't have the packages anymore. Is there a Archlinux package archive somewhere? I don't know which kernel version last worked because I updated the kernel a few times since last working reboot.

Question: Is it really a kernel bug or could it be an Archlinux bug which makes the boot environment so sensible to kernel changes that it sometimes works and sometimes doesn't?

Last edited by cro (2011-12-02 03:55:00)

Offline

#12 2011-12-02 04:05:14

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: Can an existing Arch system boot on a different machine via USB?

uff, luckily the update to kernel 3.1.4 and mkinitcpio 0.8.0-2 fixed the problem.

Offline

Board footer

Powered by FluxBB