Welcome! Log In Create A New Profile

Advanced

Load Linux from other than first partition

Posted by fredl 
Load Linux from other than first partition
October 22, 2010 07:45PM
Hi everybody,
I have a very well running setup with Debian on the first partition of a harddrive.
Now I'm trying to clone that system onto another drive for a second dockstar. Unfortunately the other drive already has partitions on it which I'm not allowed to change (it's not mine). It was no problem to transfer the system to sda5 and edit the target's fstab to new values for the root-device and swap.

Where I'm stuck now is to tell u-boot to load it from there. I already have played a bit with commands I read mainly in this thread -> "Scan all USB devices and boot from the first bootable drive."
I also managed to successfully boot it by using
usb start 
setenv usb_device 0:5; 
setenv usb_root /dev/sda5; 
run usb_boot;
but this is of course volatile.

What I would like to know now: How is the correct way to fixate this setting into u-boot? (To use /dev/sdx5 and usb_device x:5, that is)?
I'd also appreciate any link to informational sources about commands and options of the new bootloader, so I could learn more about it.

Many thanks in advance,
Fredl.
Re: Load Linux from other than first partition
October 23, 2010 01:21PM
You have two choices. You can adjust the drive scanner to check partition 5 instead of partition 1. Or, you can disable the drive scanner and tell uBoot to always boot from sda5.

To adjust the scanner, run the following commands:

setenv usb_scan_1 'usb=0:5 dev=sda5'
setenv usb_scan_2 'usb=1:5 dev=sdb5'
setenv usb_scan_3 'usb=2:5 dev=sdc5'
setenv usb_scan_4 'usb=3:5 dev=sdd5'
saveenv

To tell uBoot to only boot from sda1, do the following:

setenv usb_init
setenv usb_device '0:5'
setenv usb_root '/dev/sda5'
saveenv

The 'setenv usb_init' command disables the drive scanner. If you ever want to re-enable the drive scanner, run 'setenv usb_init run usb_scan'

-- Jeff
Re: Load Linux from other than first partition
October 23, 2010 06:21PM
Thank you, Jeff.

'saveenv' was the part I missed, although it's very obvious :)

Any hint on a more elaborate explanation of the u-boot commands, other than typing 'help'?

Regards,
Fredl.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: