I have a computer with grub and linux installed on the internal hard drive. I also have a USB flash drive with linux that I boot into with grub on the internal hard drive. This causes the USB flash drive to always be /dev/sdb. I would like to know, if I have GRUB on the USB flash drive and boot to it via the BIOS menu, will it be seen as /dev/sda instead of /dev/sdb?
1 Answer
No, it depends on the disk. For new SSD via nvme for instance the disk is called nvme0n1
. And if you have also a SATA disk you can also have a sda
disk which is not the boot drive.
As far as I know nothing prevent the computer from booting on sdb or something else, you can by the way configure the bios to use one disk in particular for booting.
-
Oh, ok. Will I be able to assume then that if I plug it into a computer that had no other USBs plugged in, it will be /dev/sdb? Feb 1 at 14:59
-
You can assume it, but there is no guarantee that it is the case. I am not sure how are decided the names (sda, sdb, etc. ) but it is the OS who does that. Also, the priority of boot is defined in the BIOS.– vinaltiFeb 1 at 15:05
-
-
I have an LFS (Linux from scratch) installation on a flash drive, and the grub.cfg needs to point to a specific drive in order to boot the correct OS Feb 1 at 15:09
-
1Is it a UEFI install or BIOS install? UEFI using gpt partitioning requires an ESP - efi system partition for grub's boot files. If old BIOS you can boot just by installing grub to MBR. But if using gpt and BIOS need a tiny 1 or 2MB unformatted partiiton with bios_grub flag ( if using gparted).– oldfredFeb 1 at 18:32
/dev/sdb