V
V
Vorb2011-08-26 17:16:20
linux
Vorb, 2011-08-26 17:16:20

How to find out in Linux: what device is the system booted from?

It is the block device with the boot record from which the current OS is loaded. On HP-UX there is a setboot command that says where the system is loaded from, but I don’t know such a way in Linux))
Perhaps there is no such way. But still interesting, maybe you can somehow get something like in HP-UX as a result of the command:
#setboot
Primary bootpath: 0/0/0/0/0.0x0000000000000000.0x0000000000000000 (/dev/rdisk/disk00)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Roman, 2011-08-26
@Vorb

Determining where to install grub:
[email protected]:/home/iam# grub-probe -t device /
/dev/sda6
[email protected]:/home/iam# grub-probe -t drive /
(/dev/sda,msdos6)

S
sl_bug, 2011-08-26
@sl_bug

"/var/log/dmesg" at the beginning look for a line similar to
Command line: BOOT_IMAGE=/boot/vmlinuz-2.6.38-11-generic root=UUID=f87d4c46-d548-48a7-9e5f-79609dea8458 ro quiet splash vt.handoff=7
then in /etc/fstab we look at UUID=f87d4c46-d548-48a7-9e5f-79609dea8458this and there is your device.

S
Sergey, 2011-08-26
@butteff

fdisk -l - displays a list of devices, the boot area is marked with an asterisk, there, as a rule, the boot mount point also lies.
In principle, the same can be seen in the hornbeam configs.
There you can also find out where the core lies.
Or I did not understand the essence of the question?

C
charon, 2011-08-29
@charon

in general, the scheme is as follows: if the MBR has a bootloader (as in Linux), then the BIOS executes it. If the bootloader is not there, then the bootloader is called from the first sector of the partition marked as bootable (Windows). This is how the x86 architecture works. I do not know a universal way for all architectures

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question