LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-10-2012, 08:49 AM   #1
Stevithen
Member
 
Registered: Sep 2009
Distribution: Debian
Posts: 55

Rep: Reputation: 15
How do I see which partition I am currently using?


From the command line, How do I see which partition I have booted to? (like a pwd for partitions)
 
Old 02-10-2012, 09:12 AM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
There is more complexity to this than just "what partition I have booted to". The kernel image may be in one partition while the root filesystem may be in another. And your system namespace (the collection of mount points) may be made up of several, depending on what distro you use and the options chosen during install.

But maybe it is sufficient to identify the root filesystem? Even that varies. Here's how I did it on my Ubuntu 10.10 system:
Code:
lorentz/phil /home/phil 1> grep ' / ' /proc/mounts
rootfs / rootfs rw 0 0
/dev/disk/by-uuid/d2ce8eef-bd9e-433d-96a1-f91c1b5aa552 / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
lorentz/phil /home/phil 2> ls -dl /dev/disk/by-uuid/d2ce8eef-bd9e-433d-96a1-f91c1b5aa552
lrwxrwxrwx 1 root root 10 Jan 31 16:46 /dev/disk/by-uuid/d2ce8eef-bd9e-433d-96a1-f91c1b5aa552 -> ../../sda3
lorentz/phil /home/phil 3>
 
Old 02-10-2012, 01:48 PM   #3
jonjgc
LQ Newbie
 
Registered: Nov 2009
Posts: 17

Rep: Reputation: 6
For this, I like to use "df" specifying a directory, such as current "." or root "/".

$ df .
Filesystem 1K-blocks Used Avail Use% Mounted on
/dev/sdb1 ... ... ... ... /home

$ df /
Filesystem 1K-blocks Used Avail Use% Mounted on
/dev/sda2 ... ... ... ... /

The examples are hypothetical as I use LVM and thus hard-formatted
"partitions" are meaningless.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HowTo convert Primary Partition to Logical (ie move it inside the Extended Partition) Tom6 Linux - Software 3 11-29-2010 03:40 PM
tricky backup of Linux system to NTFS partition to increase partition size Pandarsson Linux - General 5 07-09-2008 02:35 PM
Hard Drive Partition Management - Mandriva Double Partition with Swap File partition moshebagelfresser Linux - Hardware 2 05-23-2008 10:46 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 08:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration