2

When I added some volume to my current logical volume fedora partition I get this:

enter image description here

Is it safe to have two partitions of fedora while I wanted to add the volume to the existing one?

I created a partition named sda7 and added it to the volume group named fedora the i added all that free space to the logical volume.

The last commands that I tapped were :

# vgextend fedora /dev/sda7
# lvextend -l +100%FREE /dev/fedora/sda6
  • We need more than the last command to understand what you did. – Rui F Ribeiro Feb 10 '18 at 11:34
  • # vgextend fedora /dev/sda7 – Lina Hammami Feb 10 '18 at 11:50
  • Icreated a partition named sda7 and added it to the volume group named fedora the i added all that free space to the logical volume – Lina Hammami Feb 10 '18 at 11:51
1

Yes, it is safe. That's one of the things LVM was specifically made to do: to allow logical storage to extend beyond any single physical volume. Whether the physical volumes are partitions on the same disk, or partitions on different disks, or even whole disks with the partition table omitted, does not matter for the LVM.

Naming LVs according to the PVs they originally reside in, as you have done with LV /dev/fedora/sda6, is kind of silly. For example, if you wanted to move this Linux installation to a different disk altogether, you could take a new empty disk and create two partitions on it: the /boot partition and another partition for a LVM PV. Then you could use pvmove to move the main part of your Linux installation onto the new disk - while Linux is running. Then it's just a matter of copying the contents of the /boot partition to the new disk and installing the bootloader on it - and the LV name sda6 would be completely meaningless.

You even have separate /boot partition, so there is no risk of the boot files ending up outside the boot disk. If your /boot directory was instead just a regular directory in the root filesystem, and you extended the root LV to another disk, then the boot files - or just part of them - might end up on the other disk, and that would be a situation that could be too tricky for the bootloader to handle.

When you have /boot as a traditional partition, it ensures the boot files (= bootloader components, kernel and initramfs) all stay on the disk that is chosen as bootable in the system firmware (= BIOS or UEFI), which makes things much simpler: it guarantees the bootloader has to deal with just one type of disk controller, just one partitioning scheme, and just one disk, which the firmware definitely can read from.

1

It is perfectly normal having an extra partition; /dev/sda6 is the partition that you used to create a physical volume (PV) to add to your volume group (VG).

The image from the site www.unixarena.com should help visualize it:

lvm2

I also recommend this link

LVM Administrator's Guide

  • Before that lvextend command, there was a pvcreate /dev/sda7 and vgextend fedora /dev/sda7. The use of lvextend just like the original poster did is valid: the command translates to "add all unallocated space available in the same VG into LV /dev/fedora/sda6. The name /dev/fedora/sda6 is the legacy-compatible style LV name, so it's of the form /dev/<VG name>/<LV name>. So the name of the VG is fedora. – telcoM Feb 10 '18 at 12:47
  • @telcoM Most probably, I was suspecting that. Thanks for your input. – Rui F Ribeiro Feb 10 '18 at 12:58

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.