So I have both Ubuntu and Crunchbang installed on my laptop, and I'm trying to figure out which one is on which partition.

I'm going to install another OS (probably BT) and need to know what partition can safely be wiped.

Any tips ?

My partitions at the moment:

enter image description here

| improve this question | | | | |

If you have grub installed, run os-prober as root. It does exactly what you want.


os-prober will only list operating systems other than the one it's on: it's used by GRUB during installation to generate grub.cfg so it's natural that GRUB doesn't need info about the OS it's being installed on. To get the partition mounted as the current /, you can do this:

ROOT_PARTITION="$(readlink -e -- "$(findmnt /|awk 'END{print $2}')")"

This will fail in the unlikely case that the partition mounted as / has a space in its name.


| improve this answer | | | | |
  • Incidentally when I run that command it only reports my windows partitions, should it show all of them? I'm running it in a shell, sudo os-prober, is that OK? – slm Aug 5 '13 at 21:53
  • @slm When I run it on my system it reports all installed OSs but the one I'm on. Thanks for bringing that to my attention. I'll edit the answer to work around that. – Joseph R. Aug 5 '13 at 21:58
  • OK so it must not be working b/c I only have Windows + Fedora on this laptop, so it can't detect mounted partitions would be my guess. Perhaps if they're readonly mounted? – slm Aug 5 '13 at 22:00
  • Thank you for your answer! For me too, it only gives me where Ubuntu's partition when I run it from Crunchbang. Any way that it can give me all the OS's and partitions? – Anas Aug 5 '13 at 22:19
  • @JosephR. Actually, that helped, I just booted on Ubuntu and ran it again to figure out Debian 7 (which I'm assuming is Crunchbang here) is on /dev/sda7. As for Ubuntu itself, I found before it was on /dev/sda1. Now that brings me to a different question: on /dev/sda6 I have my /home used by Ubuntu. How should I go about installing BT ? Can I move what's on /dev/sda6 to /dev/sda1, or can I just partition it and then install a new OS ? Thank you for the help ! – Anas Aug 5 '13 at 22:48

You can use the command blkid to see what type of filesystem is on a given partition:

$ blkid
/dev/sda1: LABEL="SYSTEM_DRV" UUID="XXXX" TYPE="ntfs" 
/dev/sda2: LABEL="Windows7_OS" UUID="XXXX" TYPE="ntfs" 
/dev/sda3: LABEL="Lenovo_Recovery" UUID="XXXX" TYPE="ntfs" 
/dev/sda5: UUID="XXXX" TYPE="ext4" 
/dev/sda6: UUID="XXXX" TYPE="LVM2_member" 
/dev/mapper/vg_grinchy-lv_root: UUID="XXXX" TYPE="ext4" 
/dev/mapper/vg_grinchy-lv_swap: UUID="XXXX" TYPE="swap" 
/dev/mapper/vg_grinchy-lv_home: UUID="XXXX" TYPE="ext4" 
| improve this answer | | | | |
  • It would have helped me if I had the LABELs too, but I only get the UUID back, which doesn't tell me much :/ – Anas Aug 5 '13 at 22:19
  • @anas - yes this is only helpful if you've labeled your partitions. JosephR.'s approach is probably the best. – slm Aug 5 '13 at 23:14

cat /etc/*-release

Can be used from the terminal, just mount the partitions, then

cat /dev/sda6/etc/*-release; cat /dev/sda7/etc/*-release

| improve this answer | | | | |
  • 1
    This file is what's used by lsb_release when you run this via the command line on a Linux box. See man lsb_release. – slm Aug 5 '13 at 21:38
  • 2
    you could run lsb_release -a but you would have to chroot to which ever root directory you wanted to check first. – Eric Aug 5 '13 at 21:41
  • cat /etc/*-release only gives me my current OS, and it doesn't give me the partition it's on – Anas Aug 5 '13 at 22:25
  • You should make that clearer in your response. – jlliagre Sep 11 '13 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.