Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
Code:
df -h
or just
Code:
cat /etc/fstab
if they use UUIDS you can then
Code:
ls -al /dev/disk/by-uuid/
to see which partition the uuid is linking to
Last edited by andrewthomas; 06-30-2011 at 09:52 PM.
Reason: added UUID info
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.
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.
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
I don't have as many drives, but I have a number of partitions in my comp. I've found that if I open gparted, and right click on all the different partitions, only the one that you are using as your / will NOT have a "Delete" or "Resize/Move" option highlighted. All the other partitions will have this option. Also if you try to unmount it, gparted will throw up an error.
I guess it's not the simplest way to do things, but if it helps.................
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?
I guess that I missed the point of the question.
You want to know about which bootloader loaded the OS that you are on.
Well, the best source of information about bootloaders is
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]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.