LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   Finding the device that carry your root partition. (http://www.linuxquestions.org/questions/red-hat-31/finding-the-device-that-carry-your-root-partition-4175412124/)

howtechstuffworks 06-18-2012 03:45 PM

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.

kakaka 06-18-2012 03:57 PM

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 /

howtechstuffworks 06-18-2012 04:00 PM

^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....

michaelk 06-18-2012 04:38 PM

Have you tried searching for information on LVM? Here is a good link.
http://www.debian-administration.org/articles/410

impert 06-18-2012 04:48 PM

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.

kakaka 06-19-2012 12:38 AM

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


All times are GMT -5. The time now is 08:48 PM.