which partition did i boot from?
A bunch of drives exist on my system with a bunch of OSes. It's late at night and I forgot which partition i booted from. Is there an easy wy to figure this out? fdisk -l gives me all the partitions but how do i know which one i booted from?
|
Quote:
Code:
df -h Code:
cat /etc/fstab Code:
ls -al /dev/disk/by-uuid/ |
Do you have Gparted? It shows graphically which OS is on what partition. Like when I look at Gparted on mine I see that /dev/sda1 is Dreamlinux, and it occupies a little over 20Gigs.
So if I am using Dream I know I am on sda1. If you have it, it should be listed in Administration. Just click it and it should load the GUI. At least that is what I do. Hope this helps, Good luck. EDIT: Never mind, tried the df -h that andrewthomas posted and that is much quicker. :) |
tnx andrewthomas.
btw, i tried gparted but it doesnt say which parttion is the boot partition of the 12 that it sees on 2 hard drives and 2 usb sticks |
You are welcome.
Do you still seem to have a problem? |
cat /etc/fstab would've done itr also as andrewthomas pointed out
|
the mount command without any options shows what devices are mounted and where, so the device mounted at / should be the partition you mounted.
|
None of the answers provided address the question asked.
AFAIK there is no way to tell. |
Indeed; if you are multi-booting, then the current root '/' dir does not have to be on the disk or partition you actually booted from to start with ...
|
Unlike Windows, Linux does not make file system device names dependent on the boot file system so flamelord's answer is as good as it gets -- unless you want to know which MBR was executed and which file system was used by a boot manager such as GRUB or Lilo.
The OP question would be more meaningful under Windows where the system drive becomes C:. The question would be "Which partition is the C: drive on"? |
I guess I'll ask a question.
If I use cat /etc/fstab doesn't it only tell you about specific mounts of that os? I understand that you can add to fstab, but in my case fstab doesn't show windows os which resides on same hdd. |
Quote:
I guess it's not the simplest way to do things, but if it helps................. |
Quote:
You want to know about which bootloader loaded the OS that you are on. Well, the best source of information about bootloaders is http://bootinfoscript.sourceforge.net It is best to run it from a LiveCD to be safe. Fire up a LiveCD and navigate to the above link and post the results with your reply. Then you can look at the output of Code:
cat /etc/fstab |
For multiboot I could think of the "uname [-r]" command and the "find" command to search for any "bzimage*" "-o -iname \"vmlinu*$KERNELVERSION*\"" .
Also to "grep" for the $KERNELVERSION in the "/boot/grub/grub.cfg" or menu.lst . Grub actually loads the kernel . [edit] The boot_info_script.sh is quiet interesting 3000 lines long . Note : needs to be "chmod 0755" to become executable . Because I have 12 partitions on the main drive , I have 12 long menu.lst in the RESULTS.txt file . Because I have a wrapper script for the mount command I can say for now : It mounts every partition and looks for kernels and grub-files . Thanks for posting the link ! It is much more sophisticated , than the thoughts I posted . [/edit] |
Quote:
You can make some presumptions (as you have), but from a running instance of a system, there is no way to *know*. It's even possible the instance wasn't booted from a partition at all - that is what kexec provides. |
All times are GMT -5. The time now is 06:11 PM. |