LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 06-18-2012, 03:45 PM   #1
howtechstuffworks
LQ Newbie
 
Registered: Jan 2011
Posts: 8

Rep: Reputation: 0
Finding the device that carry your root partition.


Hi all,
Is there a command that will give me the (root) device that is mapped against the root partition. I was able to find out base Volume Group with commands like "ls -ltr" && "dmsetup info -m <x> -j <y>"... Not sure how to proceed on this.. Are there some good article, that will help me to understand linux devices.
 
Old 06-18-2012, 03:57 PM   #2
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 86
I'm using volume groups, and for me, either of this work to display the volume mounted on slash ( root ):

Code:
mount -v | fgrep 'on / '
Code:
df -k /
 
Old 06-18-2012, 04:00 PM   #3
howtechstuffworks
LQ Newbie
 
Registered: Jan 2011
Posts: 8

Original Poster
Rep: Reputation: 0
^Well, that gives me

/dev/mapper/VolGroup-LogVol00, but what I need is /dev/sda2(in my case)..... the actual device I could use for pvcreate command....
 
Old 06-18-2012, 04:38 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,969

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
Have you tried searching for information on LVM? Here is a good link.
http://www.debian-administration.org/articles/410
 
Old 06-18-2012, 04:48 PM   #5
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 53
Code:
grep '/ ' /etc/fstab |sed 's/\ .*//'
Works for me.
I forgot: It works for me because I don't use UUIDs. If you do, this will give you the UUID, but you can convert with blkid. A good little exercise.

Last edited by impert; 06-18-2012 at 04:53 PM. Reason: duh, forgot about uuids, duh
 
Old 06-19-2012, 12:38 AM   #6
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 86
hi howtechstuffworks!

It would appear that you asked the wrong question.

The question you actually seem to have wanted answered was:

Quote:
How do I find the physical device, which contains the logical volume that is mounted on /
Take logical volume group name from the logical device name, then use it in place of volume_group_name in this command:

Code:
vgdisplay  -v  volume_group_name
For me that displays information on the volume group as a whole, the individual logical volumes within the group, and lists the physical volumes that contain the logical volume group.

I simply use the manual pages for information.

Code:
apropos keyword | less
is nice for finding things. If you don't have the apropos command, you should be able to substitute man -k
 
  


Reply

Tags
devices, lvm2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB error finding root filesystem partition smanandhar Linux - Newbie 3 02-16-2009 10:47 AM
shrinking root partition and using free space to create a block device kickdgrass Linux - General 1 02-04-2009 05:04 AM
Kernel 2.6.26.3: VFS cannot open root device, can't find root device dimm0k Linux - Kernel 1 09-21-2008 03:19 PM
ram image not finding root block (3,1) partition fourcs Linux - General 4 05-26-2007 05:58 AM
How to disable DMA in Partition check and Creating root device ComputeWorldwide Linux - Newbie 0 05-09-2006 07:58 PM


All times are GMT -5. The time now is 11:57 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration