1

I got a Debian installed on EFI system with LVM on top of a RAID 1, it's working fine except that fdisk gives me warning

# fdisk -l
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 84D87237-49E3-4132-AAAD-C242C572D597

Device       Start        End    Sectors  Size Type
/dev/sda1     2048    1050623    1048576  512M EFI System
/dev/sda2  1050624    1550335     499712  244M Linux RAID
/dev/sda3  1550336 3907028991 3905478656  1.8T Linux RAID


Disk /dev/md1: 1.8 TiB, 1999470854144 bytes, 3905216512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: D797F4C6-B88E-4E57-9D7D-5B323F9CDCA5

Device       Start        End    Sectors  Size Type
/dev/md1p1    4096    1054719    1050624  513M EFI System
/dev/md1p3 1550817 3905216478 3903665662  1.8T Linux LVM

Partition 3 does not start on physical sector boundary.


Disk /dev/md0: 243.8 MiB, 255655936 bytes, 499328 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 84D87237-49E3-4132-AAAD-C242C572D597

Device       Start        End    Sectors  Size Type
/dev/sdb1     2048    1050623    1048576  512M EFI System
/dev/sdb2  1050624    1550335     499712  244M Linux RAID
/dev/sdb3  1550336 3907028991 3905478656  1.8T Linux RAID


Disk /dev/mapper/Gladys--vg-root: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/Gladys--vg-swap_1: 31.9 GiB, 34183577600 bytes, 66764800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

I found a few tutorials explaining how to fix this except that because of the LVM it doesn't work.

So guys can you help me ?

  • Is there data in the LVM? If so then how much? – Hauke Laging Dec 31 '17 at 21:13
  • there is 6.4Go of data why ? – bobzer Jan 2 '18 at 0:02
1

The reason for the warning is that you get a performance problem if you have a 4K drive and the partitions (and/or other data structures like the LVM extents) are not aligned to the 4K boundaries.

It seems to me that it is impossible to change the alignment of an existing volume group. So the question is: What is the least painful way to copy the LVM data?

You could:

  1. reduce the size of the LV filesystems
  2. reduce the size of the LVs
  3. reduce the size of the PV
  4. reduce the size of its partition (to 10 GiB)
  5. create a new, correctly aligned partition in the free space
  6. make the new partition a new PV
  7. extend the VG to the new PV
  8. move all the extents (the data) from the old PV to the new PV
  9. delete the old PV from the VG

or

  1. reduce the size of one LV filesystem (by 10 GiB)
  2. reduce the size of that LV
  3. reduce the size of the PV
  4. reduce the size of its partition
  5. create a new, correctly aligned partition in the free space
  6. make a filesystem level backup of all your LVM data to the new partition
  7. throw away the whole VG and PV
  8. correct the partition alignment
  9. create a new PV, VG and LVs
  10. restore the data
  11. delete the backup partition
  12. enlarge the PV partition to the free space
  13. enlarge the PV
|improve this answer|||||
  • unfortunately lvreduce fail because it's a thin pool – bobzer Jan 2 '18 at 5:39
  • luckily my lvm thin partition was empty (new system) so i deleted it and was then able to move with your 2nd solution thanks – bobzer Jan 2 '18 at 22:25

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.