How to Format an LVM partition
48,174
LVM doesn't change the way you format a partition. Let's say you would have a volume group called group1
and a logical volume called volume1
then your command should look like this for ext3:
mkfs.ext3 /dev/group1/volume1
In case you don't have any volume groups or logical volumes yet, you have to use the according LVM tools to create them. The manpages of vgcreate
and lvcreate
can tell you how to do that.
Related videos on Youtube
Comments
-
OmiPenguin over 1 year
I need to format a partition.
But I have one LVM on my machine (VirtualBox) that is composed of two different two partitions of two Virtual HDD's (sdb5 and sdc5)
fdisk output
df output
-
bsd about 11 yearsYou need to add more detail to your question. Is that VirtualBox on a Logical Volume, or a Logical Volume within VirtualBox? How many Volume Groups? How were they created, ie from which Physical Volumes?
-
bsd about 11 yearsSo RH is on VBox. What OS is VirtualBox running on top of? You initialize "Physical Volumes" with pvcreate, then group PVs into a "Volume Group". From a volume group you create "Logical Volumes" each of which may be formatted with any file system you chose. The issue is that if you created the Volume Group/Logical Volumes from the OS running VirtualBox, then you need to manage the VG/LV from that OS, not from the VBox client OS, it will be dealing with virtual disks.
-
-
OmiPenguin about 11 yearsNo I have Volume Group and LV
-
replay about 11 yearsin that case you just use the normal mkfs tools on the device you want to format. the lvm devices are presented as /dev/lvgroup/lvolume
-
replay about 11 yearsi just saw your df output only now. on your case the device for your logical volume should be /dev/mapper/VolGroup00-LogVol00
-
OmiPenguin about 11 yearsFor some reason before posting question it mkfs said that device is in use when I already unmounted the partition. But now its ok Thanks for giving me info