Tiny Core Linux
General TC => General TC Talk => Topic started by: Scooby on February 12, 2013, 05:39:24 AM
-
I boot TinyCore from USB,
If you have several USB sticks attached is there a way of knowing
from which you booted?
-
No.
-
Hi Scooby
Actually, in this case maybe. If you have your tce directory on the stick you are booting from, and your boot loaders
config file has a statement similar to:
waitusb=5:UUID="77f3e5df-806f-480c-b6cc-905cb3132753" tce=UUID="77f3e5df-806f-480c-b6cc-905cb3132753"
Then /etc/sysconfig/tce.mount will tell you where you booted from.
-
That would determine the device on which tce dir is located.
Drawing any conclusions from that referring to boot device would be purely speculative.
-
No it won't.
You cannot tell where you booted from.
The boot loader loads the kernel and initrd, and execs the kernel.
The above example could have been pxe booted, or booted from a CD.
The fact that it found a boot loader that specified the current tce directory does not mean that boot loader loaded the kernel.
You might bury bogus boot strings in the config files that you can use programatically as hints, but the fact is that the kernel
has no knowledge of how it was loaded.
-
Hi tinypoodle
Maybe my explanation was unclear. Let me rephrase:
1. If the boot loader is located on the stick you are booting from
2. and the boot loaders config file sets tce equal to the UUID of the stick
3. Then /etc/sysconfig/tce.mount will indicate the boot drive
-
Hi gerald_clark
Yes, yes, yes, yes, and yes. :) Based on the OPs question, I presumed (maybe incorrectly) that the boot loader was
also installed on the stick, and based my answer on that particular scenario.
-
No it does not. It only indicates the drive that holds the tce directory.
You cannot be assured that the kernel was booted from that drive, even if that drive has a bootloader.
It could have been booted from pxe, a hard drive, a CD, or another stick.
-
Hi gerald_clark
In general you are correct, no argument. One of the few exceptions is if you install Tinycore to a stick, tell the
boot loader to boot from the stick, and set tce equal to the UUID of the stick.
-
And the tce directory and kernel have to be on the same partition on the stick.
-
A few notes:
- There is no requirement for boot device to remain attached as soon as the bootloader has finished loading kernel and initrd into memory.
- There is no requirement for the kernel to have support built in for boot device.
- There is no requirement of BIOS supporting boot via USB in order to have any kind of persistence loaded over USB at boot time.
-
There is no exception.
The kernel CANNOT tell where it was booted from.
All your examples rely on guesses based on circumstantial evidence.
The fact that you have a tce directory and a boot loader on the same USB stick does not guarantee that it was booted from that stick.
-
There is no exception.
The kernel CANNOT tell where it was booted from.
That's why initially I had considered my Reply #1 as being sufficient... :P
-
Hi Scooby
Maybe if you provide some more details of your situation and what you are trying to achieve someone can
provide you with a workable solution.
-
If OP intends to try out various installs on different sticks can I make suggestion
if you have a hub.....always put the "booting" usb stick into (say) top left hand slot
as you boot, most sticks have an light that flashes when read (or written to) so you know thats your boot stick
It may not pass any computer test but I am simple minded...ok I am idiot