Welcome! Log In Create A New Profile

Advanced

Change device ordering when booting from usb

Posted by SomeoneOnLine 
Change device ordering when booting from usb
January 02, 2014 06:51PM
physical drive "dev" ordering when booting from usb versus sata drive.

If I boot from the left sata drive with a matching drive in the right drive bay the left drive is /dev/sda and the right drive bay is /dev/sdb and a attached usb drive is /dev/sdc which is fine.

If I boot from usb the order changes where the left drive is /dev/sda and the right drive is /dev/sdc and the usb drive plugged in the the rear usb that its booting debian from is /dev/sdb.

Is there anyway I can change the order when booting from usb? or does it matter which port I plug the usb drive into? I would like to have the usb drive be /dev/sda and left bay be /dev/sdb and right bay be /dev/sdc. I ordered a new low profile flash drive to put the boot and rootfs on and raid1 the left and right sata drives. I know it might not really matter as long as I keep track of which drive is which I would just hate to have a rouge usb drive plugged into the front usb port and have it rebooted and change device numbers and affect other misc scripts I have run at boot or something.

Hopefully I asked that correctly. :)

Thanks,

~SOL



Edited 1 time(s). Last edit at 01/03/2014 01:21AM by SomeoneOnLine.
Re: Change device ordering when booting from usb
January 03, 2014 12:47AM
It might be that usb is not getting powered up completely and hence at times the ordering would change you might have to put a sleep in your boot_cmd to wait for usb drive to come up.
Re: Change device ordering when booting from usb
January 03, 2014 01:58AM
SOL,

There is no sure way to control the device ordering. It is purely depending on which USB/SATA device "spins" up first. Usually SATA always come up first. But if you have more than one USB ports, USB drives assignment is trial-and-error. The only sure way to control the drives selection is using disk label, and uBoot envs to select one you prefer in a certain order.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/03/2014 02:01AM by bodhi.
Re: Change device ordering when booting from usb
January 03, 2014 02:41AM
ok. fare enough. Thanks for the info.
Re: Change device ordering when booting from usb
January 06, 2014 09:06AM
Yes, USB drive assignment is really pot-shot.

SATA will nearly always come up priot to USB drives if only because the SATA contoller is initialized prior to the USB host controllers (let alone hubs that might be attached)

You could (and should) look into labelling &| UUID/PARTUUID
Re: Change device ordering when booting from usb
January 07, 2014 08:28PM
Thanks. I figured sata would start first but in this case sda is sata1 sdb is usb and sdc is sata2. I just though it was weird that the usb was in the middle and not in the beginning or end but not in the middle.
Re: Change device ordering when booting from usb
January 07, 2014 10:41PM
SOL,

If you run Debian then using label for each disk would be the best approach, IMO. If you run Arch without initrd, UUID/PARTUUID is the only way to ensure the recognition, AFAIK. But you can also run Arch with initrd, too (see moonman instructions at ALARM site).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Change device ordering when booting from usb
January 08, 2014 03:59PM
You can indeed run ALARM with initrd, we just don't provide it for you and you will need to follow the wiki in configuring the necessary hooks.
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: