In the event that something goes wrong with my desktop, other than a problem with the hard drive, I want to be able to boot from the hard drive that normally resides in my desktop but with it connected as an external hard drive to my laptop.
My laptop is a Thinkpad R51. In the BIOS there is an option to boot from: -USB Hard Drive. I don't know what the '-' in front of the USB is for - none of the other USB boot options has a dash in front of it.
I've compiled a 2.6.8 kernel, on the (external) hard drive, to suit the Thinkpad and the Thinkpad will start to boot from that drive after I select the special kernel but stops with a kernel panic:
VFS: Cannot open root device "30e" or unknown-block(3,14) Please append a correct "root=" boot option Kernel panic: VFS: Unable to mount root fs on unknown-block(3,14)
The Linux root partition on that disk is partition 14.
When I've had this sort of problem before it's been because I've had and IDE opion either unset or set as a module instead of being compiled in but I've checked and rechecked and cannot see what is wrong.
The relevant IDE kernel settings are:
# # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_CMD640=y # CONFIG_BLK_DEV_CMD640_ENHANCED is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_ATIIXP is not set # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SIS5513 is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_ARM is not set # CONFIG_IDE_CHIPSETS is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set
I copied the kernel config from the laptop initially and changed the IDE settings to suit the hard drive on the desktop.
Can anyone suggest anything I have missed?
On Sun, 2006-01-15 at 12:51 +0000, Barry Samuels wrote: [snip]
I copied the kernel config from the laptop initially and changed the IDE settings to suit the hard drive on the desktop.
Can anyone suggest anything I have missed?
Not something I have played with before but isn't it possible that once the kernel has booted the device nodes may change (the drive won't be on /dev/hda because that would be your Laptops internal drive surely) and it is probably therefore needing something like /dev/sda for the usb mass storage controller.
On 2006.01.15 16:07, Wayne Stallwood wrote:
Not something I have played with before but isn't it possible that once the kernel has booted the device nodes may change (the drive won't be on /dev/hda because that would be your Laptops internal drive surely) and it is probably therefore needing something like /dev/sda for the usb mass storage controller.
You've hit the nail on the head there Wayne. I hadn't realised that it would appear as a SCSI drive. SCSI Disc support was not set in the kernel although I have now corrected that but I won't be trying it again until tomorrow.
Thanks
On Sun, 2006-01-15 at 18:42 +0000, Barry Samuels wrote:
You've hit the nail on the head there Wayne. I hadn't realised that it would appear as a SCSI drive. SCSI Disc support was not set in the kernel although I have now corrected that but I won't be trying it again until tomorrow.
Thanks
How do you get around the fstab pointing to the wrong device node, surely the USB mass storage is going to be sda but your fstab is going to be hda etc....or will the kernel boot up still in init 1 or something so that you can manually mount the partitions...you've got me interested now I might have to try this.
On 2006.01.15 19:34, Wayne Stallwood wrote:
How do you get around the fstab pointing to the wrong device node, surely the USB mass storage is going to be sda but your fstab is going to be hda etc....or will the kernel boot up still in init 1 or something so that you can manually mount the partitions...you've got me interested now I might have to try this.
The only thing I could think of was to set up another fstab with a different name and before I connect the disc to the Thinkpad I change them over.
Not very elegant but I hope it works.
The other thing that bothered me a little was the boot=/dev/hda in lilo.conf. I've set up a root=/dev/sda14 in the image section and the laptop does boot from the external drive so I'll wait and see what happens tomorrow when I try it.
Barry Samuels http://www.beenthere-donethat.org.uk The Unofficial Guide to Great Britain
On 2006.01.15 20:09, Barry Samuels wrote:
The only thing I could think of was to set up another fstab with a different name and before I connect the disc to the Thinkpad I change them over.
Not very elegant but I hope it works.
The other thing that bothered me a little was the boot=/dev/hda in lilo.conf. I've set up a root=/dev/sda14 in the image section and the laptop does boot from the external drive so I'll wait and see what happens tomorrow when I try it.
Well - so far no good!
After changing the 'root=' option in lilo to /dev/sda14 instead of /dev/hda14 it still produces a kernel panic except that it refers to (8,14) instead of (3,14).
These are the only SCSI options set in the kernel config.
# # SCSI device support # CONFIG_SCSI=y # CONFIG_SCSI_PROC_FS is not set
# # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y
/dev/sda14 exists in the /dev directory and I can mount the external drive if I boot from the laptop's internal hard drive.
I'm lost for ideas now. :-((
I'm lost for ideas now. :-((
Trying it here now and running into similar problems.
Perhaps the best way of learning how to do this is to download an image of a USB booting distro (DSL or something) and see how they do it.
If not then this document is a little out of date but seems to be speaking some sense.
http://www-128.ibm.com/developerworks/linux/library/l-fireboot.html?ca=dgr-l...
Primarily it is talking about firewire boots but most of this should also apply to USB booting.
Pay special attention to about halfway down where it is talking about one phase and two phase boots.
This bit in particular could be the source of your problem
[snip]
This almost works, except for two problems:
1. Because of the fact that SBP support uses SCSI emulation, the emulated SCSI bus need to be "rescanned" in order to detect the disk and allow /dev/sda1 to be mounted. This scanning is performed with a couple of simple commands. Unfortunately, however, using a one-phase boot, we cannot run any commands until the kernel has finished booting, and the kernel cannot finish booting until the root file system is mounted -- a classic Catch-22 situation. Thankfully, there is a patch available for 2.4 kernels that causes the SCSI bus to be scanned on startup (see Resources for more details). By applying this patch, I was able to have the external drive automatically detected by the kernel during bootup with no rescanning commands required. This leads us to the next problem. 2. There is a timing window within the kernel, which means that often, the kernel will proceed to try to mount the root device before it has had a chance to be properly detected or initialized. Again, there is a patch available for this (please see Resources for a link) that simply makes the kernel wait for a short period of time on startup, and retry if it fails to mount the root filesystem (to give the external drive time to be recognized).
By applying these two patches, I was successfully able to build a kernel on a bootable floppy disk, which would boot and then use the external FireWire drive as root.
The main problem with this approach is that it requires us to patch the kernel source -- which is at best a pain (when new kernel versions are released) and at worst, a real problem (if the patches are not maintained to keep in step with the other changes occurring to the kernel).
It may have occurred to you that we can avoid these two problems if our BIOS supports USB or FireWire and we are booting directly. Unfortunately, this is not the case: while this method uses BIOS calls to access the disk during boot up, once the kernel begins to initialize, the BIOS is no longer used, and the disk is accessed using the kernel drivers -- so the same problems are encountered.
[snip]
interesting huh ?
Hi,
I've been experimenting with making a USB flash drive bootable. I've got a 512MB pen drive with Gentoo on it. I had to add the rootdelay option to the kernel boot options, otherwise I'd get a kernel panic. I also had to build SCSI, usb and usb-storage into the kernel.
The extract from my lilo.conf (OK, I know grub is fashionable these days, but I find Lilo far more friendly!) shows how to use it.
image = /boot/vmlinuz-2.6.14 root = /dev/sda2 label = Gentoo read-only # read-only for checking append = "lapic rootdelay=10"
HTH
Chris
On Mon, 2006-01-16 at 21:58 +0000, Wayne Stallwood wrote:
I'm lost for ideas now. :-((
Trying it here now and running into similar problems.
Perhaps the best way of learning how to do this is to download an image of a USB booting distro (DSL or something) and see how they do it.
If not then this document is a little out of date but seems to be speaking some sense.
http://www-128.ibm.com/developerworks/linux/library/l-fireboot.html?ca=dgr-l...
Primarily it is talking about firewire boots but most of this should also apply to USB booting.
Pay special attention to about halfway down where it is talking about one phase and two phase boots.
This bit in particular could be the source of your problem
[snip]
This almost works, except for two problems:
1. Because of the fact that SBP support uses SCSI emulation, the emulated SCSI bus need to be "rescanned" in order to detect the disk and allow /dev/sda1 to be mounted. This scanning is performed with a couple of simple commands. Unfortunately, however, using a one-phase boot, we cannot run any commands until the kernel has finished booting, and the kernel cannot finish booting until the root file system is mounted -- a classic Catch-22 situation. Thankfully, there is a patch available for 2.4 kernels that causes the SCSI bus to be scanned on startup (see Resources for more details). By applying this patch, I was able to have the external drive automatically detected by the kernel during bootup with no rescanning commands required. This leads us to the next problem. 2. There is a timing window within the kernel, which means that often, the kernel will proceed to try to mount the root device before it has had a chance to be properly detected or initialized. Again, there is a patch available for this (please see Resources for a link) that simply makes the kernel wait for a short period of time on startup, and retry if it fails to mount the root filesystem (to give the external drive time to be recognized).
By applying these two patches, I was successfully able to build a kernel on a bootable floppy disk, which would boot and then use the external FireWire drive as root.
The main problem with this approach is that it requires us to patch the kernel source -- which is at best a pain (when new kernel versions are released) and at worst, a real problem (if the patches are not maintained to keep in step with the other changes occurring to the kernel).
It may have occurred to you that we can avoid these two problems if our BIOS supports USB or FireWire and we are booting directly. Unfortunately, this is not the case: while this method uses BIOS calls to access the disk during boot up, once the kernel begins to initialize, the BIOS is no longer used, and the disk is accessed using the kernel drivers -- so the same problems are encountered.
[snip]
interesting huh ?
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above! -- This email has been verified as Virus free Virus Protection and more available at http://www.plus.net
On Mon, 2006-01-16 at 22:26 +0000, Chris Glover wrote:
Hi,
I've been experimenting with making a USB flash drive bootable. I've got a 512MB pen drive with Gentoo on it. I had to add the rootdelay option to the kernel boot options, otherwise I'd get a kernel panic. I also had to build SCSI, usb and usb-storage into the kernel.
I am assuming that Barry has the necessary kernel bits as he has said that the USB boot kernel is built with a similar config to his laptop one and that mounts a USB volume.
But the lapic rootdelay=10 is a good tip...as soon as I have finished the real work I am doing here I will give that a go.
Cheers Wayne
On Mon, 2006-01-16 at 22:59 +0000, Wayne Stallwood wrote:
But the lapic rootdelay=10 is a good tip...as soon as I have finished the real work I am doing here I will give that a go.
Actually that's two seperate options, the lapic is needed as my HP laptop disables it's APIC by default.
I found without the rootdelay option, it would try mounting the root device before the pendrive had worked out it wasn't a paperweight :-)
Have a look in /usr/src/linux/Documentation/kernel-parameters.txt
HTH
Chris
On Mon, 2006-01-16 at 23:16 +0000, Chris Glover wrote:
Actually that's two seperate options, the lapic is needed as my HP laptop disables it's APIC by default.
Yes sorry that was a cut n paste error
Didn't know there were quite that many options...also interesting to me is the AMD64 specific ones in x86_64/boot-options.txt...loads of new and interesting ways to break my system in there...just going to go and play with the early console options now.
On 2006.01.16 22:59, Wayne Stallwood wrote:
I am assuming that Barry has the necessary kernel bits as he has said that the USB boot kernel is built with a similar config to his laptop one and that mounts a USB volume.
He thinks he has. :-))
I have built in IDE support (see my first post for config options), USB support (see below for config options) and SCSI support (see my 4th post for config options) but NOT SCSI emulation (Do I need that with a 2.6.8 kernel?).
# # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set
# # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y CONFIG_USB_BANDWIDTH=y # CONFIG_USB_DYNAMIC_MINORS is not set
# # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=y CONFIG_USB_UHCI_HCD=y
# # USB Device Class drivers # CONFIG_USB_AUDIO=m
# # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # CONFIG_USB_MIDI=m CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_HP8200e=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y
# # USB Human Interface Devices (HID) # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y # CONFIG_HID_FF is not set CONFIG_USB_HIDDEV=y
# # USB HID Boot Protocol drivers # # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set
I read the article, Wayne, but wonder if this applies to a 2.6 kernel. I did mention that I'm using kernel 2.6.8 but I don't know if that will be drastically different from a 2.4 kernel.
But the lapic rootdelay=10 is a good tip...as soon as I have finished the real work I am doing here I will give that a go.
I tried "append = "rootdelay=10" in the image section but noticed no delay in boot up and it still failed. Should there be a noticeable delay?
But the lapic rootdelay=10 is a good tip...as soon as I have finished the real work I am doing here I will give that a go.
I tried "append = "rootdelay=10" in the image section but noticed no delay in boot up and it still failed. Should there be a noticeable delay?
Yep, it should just sit there for 10s before saying "mounting root filesystem"
HTH
Chris
On Tue, 2006-01-17 at 13:46 +0000, Barry Samuels wrote:
He thinks he has. :-))
I have built in IDE support (see my first post for config options), USB support (see below for config options) and SCSI support (see my 4th post for config options) but NOT SCSI emulation (Do I need that with a 2.6.8 kernel?).
This is a guess and not an informed opinion but I assume that if they had dropped the SCSI emulation requirement then the USB attached drive would not be still running on SCSI disk device nodes.
I read the article, Wayne, but wonder if this applies to a 2.6 kernel. I did mention that I'm using kernel 2.6.8 but I don't know if that will be drastically different from a 2.4 kernel.
I think at least parts of it are still relevant (perhaps not the rescanning SCSI bit) if only because it seems that your failure is happening at the same point as described in the article (when the kernel takes over disk access from the USB bios boot mode)
I tried "append = "rootdelay=10" in the image section but noticed no delay in boot up and it still failed. Should there be a noticeable delay?
Hmmmm..thinking
In one random straw clutching moment I was thinking that devfs may be needed for usb storage in 2.6.8 (do the earlier 2.6 series kernels still use devfs rather than udev) I am wondering if the usb mass storage driver can not create the device nodes without it...If I had not left my USB drive at work I would be trying to append devfs=mount as well.
Further to my previous posts "Boot problem with external drive" I have at last got it to start booting.
Wayne's link provided the solution. I included an initrd image with a built in delay, waiting for the drive to 'appear', and it has now started to boot.
However when I started to get some odd messages, during boot, I realised that the drive I'm trying to boot from was on my desktop, with one network address, and the laptop I'm now using to boot it is assigned a different network address causing the poor thing some confusion.
I shall try and boot it again, but not tonight, without the desktop connected to the network so that I can give the laptop the address normally assigned to the desktop. Then we shall see what happens.
Thanks to the people who provided help.
Barry Samuels http://www.beenthere-donethat.org.uk The Unofficial Guide to Great Britain
There errors that I'm getting are apparently because the remaining partitions are not being mounted.
The root partition is obviously being mounted because it's booting from that and fstab is being read because it tries to mount the other partitions but there is a message for each of the other partitions along the lines of 'special device /dev/sda7 does not exist'.
The devices in /dev for the other partitions do exist and have the correct permissions and just to be sure I deleted and re-created them with the same result.
Suggestions welcomed.
Barry Samuels http://www.beenthere-donethat.org.uk The Unofficial Guide to Great Britain
On Sat, 2006-01-28 at 12:05 +0000, Barry Samuels wrote:
There errors that I'm getting are apparently because the remaining partitions are not being mounted.
The root partition is obviously being mounted because it's booting from that and fstab is being read because it tries to mount the other partitions but there is a message for each of the other partitions along the lines of 'special device /dev/sda7 does not exist'.
sda7 suggests the 7th partition on your drive...do you really have that many ?
Perhaps you could post your fstab here for us to take a look at.
Cheers Wayne
On 2006.01.28 18:18, Wayne Stallwood wrote:
On Sat, 2006-01-28 at 12:05 +0000, Barry Samuels wrote:
There errors that I'm getting are apparently because the remaining partitions are not being mounted.
The root partition is obviously being mounted because it's booting
from that and fstab is being read because it tries to mount the other
partitions but there is a message for each of the other partitions along the lines of 'special device /dev/sda7 does not exist'.
sda7 suggests the 7th partition on your drive...do you really have that many ?
Not really. sda1 is an extended partition with sda5 as swap, sda6 as /, sda7 as /home, sda8 as /usr, sda9 as /usr/local and sda10 as /var.
Perhaps you could post your fstab here for us to take a look at.
================================================================ # /etc/fstab: static file system information. # /dev/sda6 / ext3 defaults,errors=remount-ro 0 1 /dev/sda5 none swap sw 0 0 proc /proc proc defaults 0 0 none /proc/bus/usb usbfs defaults 0 0 /dev/sda7 /home ext3 defaults 0 2 /dev/sda8 /usr ext3 defaults 0 2 /dev/sda9 /usr/local ext3 defaults 0 2 /dev/sda10 /var ext3 defaults 0 2
/dev/cdrom /cdrom iso9660 ro,noauto,user,exec,unhide 0 0 /dev/scd0 /cdrom iso9660 ro,noauto,user,exec,unhide 0 0 /dev/dvd /cdrom udf ro,noauto,user,exec,unhide 0 0 /dev/fd0 /floppy ext2 noauto,user 0 0 ======================================================================
Cheers Wayne
Sorry if it wraps.
Barry Samuels http://www.beenthere-donethat.org.uk The Unofficial Guide to Great Britain
I've finally got my USB/IDE external drive to boot properly.
All I had to do was to disable devfs in the kernel. It needs a little tidying to get the kernel settings and modules just right but it does work.
My next step is an alternative XF86Config-4 for the laptop screen instead of the desktop LCD monitor so that I can try running X.
Barry Samuels http://www.beenthere-donethat.org.uk The Unofficial Guide to Great Britain