1

My system currently has a volume group containing root, swap, and home logical volumes. I would like to reinstall the operating system in the root volume and format the partition in the process. I don't know how logical volumes work so I don't know if there is any information about the volume group that is stored on the root partition. If I reformat the root partition, will this remove my ability to access the volume group?

2

Unless you want to rebuild your LVM structure, you should not format any partitions. Instead, you should format the logical volumes through the device mapper. Run lsblk. You'll see something like this:

`-sda2                         8:2    0 4.5G  0 part 
  `-VolGroup00-lvolroot      254:0    0 4.5G  0 lvm  /

As you can see, the mapper has made a mapped device available named VolGroup00-lvolroot. Formatting the partition that this logical volume lives on would remove the logical volume. You would end up with your root filesystem directly on the partition. It would end up looking something like this:

`-sda2                         8:2    0 4.5G  0 part /

The logical volumes are usually accessible in the /dev/mapper directory as symbolic links to files in /dev named dm-*. For example, the VolGroup00-lvolroot volume is accessible at /dev/mapper/VolGroup00-lvolroot. If you're making a new filesystem for your root partition, you should run something along the lines of

mkfs.ext4 /dev/mapper/VolGroup00-lvolroot
| improve this answer | |
  • So I just need to be sure I specify the root logical volume, not partition when I install the OS. – drs Jul 24 '13 at 12:32
  • That is correct. – user26112 Jul 24 '13 at 13:07

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.