Pvmove states that there is no data to move, I think there is

I want to move all physical extends from my /dev/fedora/root logical volume to one specific physical volume.

The physical volume I want to move the physical extends to is /dev/mapper/luks-8e9ad3a2-d456-4561-9153-30f82f30ae9b.

# pvscan
  PV /dev/mapper/luks-23d92739-0aa1-4ffc-af64-18fc524bad5b   VG fedora   lvm2 [<487.85 GiB / 0    free]
  PV /dev/mapper/luks-f29fc668-9a4c-4b15-87f2-c6981be1e840   VG fedora   lvm2 [<232.88 GiB / 0    free]
  PV /dev/mapper/luks-42ccf8b7-fcb4-416b-b707-9a97ec819239   VG fedora   lvm2 [<5.46 TiB / 801.84 GiB free]
  PV /dev/mapper/luks-8e9ad3a2-d456-4561-9153-30f82f30ae9b   VG fedora   lvm2 [3.72 TiB / 3.72 TiB free]
  Total: 4 [<9.89 TiB] / in use: 4 [<9.89 TiB] / in no VG: 0 [0   ]

The logical volume from which I want to move the physical extends from is /dev/fedora/root

# lvscan
  ACTIVE            '/dev/fedora/root' [1000.00 GiB] inherit
  ACTIVE            '/dev/fedora/home' [4.39 TiB] inherit
  ACTIVE            '/dev/fedora/swap' [7.89 GiB] inherit

There are no physical extends from logical volume /dev/fedora/root yet on physical volume /dev/mapper/luks-8e9ad3a2-d456-4561-9153-30f82f30ae9b:

# lvdisplay -m /dev/fedora/root
  --- Logical volume ---
  LV Path                /dev/fedora/root
  LV Name                root
  VG Name                fedora
  LV UUID                7fTsmn-GmgL-WpnK-Cx2k-alrK-Kf6E-TGo8A4
  LV Write Access        read/write
  LV Creation host, time localhost-live, 2017-04-25 19:45:34 +0200
  LV Status              available
  # open                 1
  LV Size                1000.00 GiB
  Current LE             256000
  Segments               3
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:4
   
  --- Segments ---
  Logical extents 0 to 25599:
    Type		linear
    Physical volume	/dev/mapper/luks-23d92739-0aa1-4ffc-af64-18fc524bad5b
    Physical extents	0 to 25599
   
  Logical extents 25600 to 127999:
    Type		linear
    Physical volume	/dev/mapper/luks-42ccf8b7-fcb4-416b-b707-9a97ec819239
    Physical extents	788735 to 891134
   
  Logical extents 128000 to 255999:
    Type		linear
    Physical volume	/dev/mapper/luks-42ccf8b7-fcb4-416b-b707-9a97ec819239
    Physical extents	1097515 to 1225514

So I would expect that this command whould move the physical extends of /dev/fedora/root to /dev/mapper/luks-8e9ad3a2-d456-4561-9153-30f82f30ae9b:

# pvmove -i5 -v --autobackup y -n /dev/fedora/root /dev/mapper/luks-8e9ad3a2-d456-4561-9153-30f82f30ae9b
  Creating logical volume pvmove0
  No data to move for fedora.

But the command states: No data to move for fedora.

What am I doing wrong, or what do I not understand correctly?

Correct the command as follows:

  • Use the source PV as the first positional argument.
  • Use the destination PV as the second positional argument.
  • Address the LV by its short name.

This is deduced from the examples:
pvmove: Move extents from one physical volume to another | lvm2 System Administration | Man Pages | ManKier

1 Like

Thanks @vgaetera. It works now with e.g.:

pvmove -i5 -v --autobackup y -n /dev/fedora/root /dev/mapper/luks-23d92739-0aa1-4ffc-af64-18fc524bad5b /dev/mapper/luks-8e9ad3a2-d456-4561-9153-30f82f30ae9b
1 Like