2

I had a LVM group on a single SSD, and after running out of space I've extended it to HDD. Now I bought a bigger SSD, and want to move everything there.

$ sudo lvm vgs   
  VG                    #PV #LV #SN Attr   VSize    VFree
  fedora_localhost-live   3   2   0 wz--n- <266.74g 8.00m

$ sudo pvscan
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  PV /dev/sdb2   VG fedora_localhost-live   lvm2 [<118.31 GiB / 0    free]
  PV /dev/sda4   VG fedora_localhost-live   lvm2 [<99.61 GiB / 4.00 MiB free]
  PV /dev/sda5   VG fedora_localhost-live   lvm2 [48.82 GiB / 4.00 MiB free]
  Total: 3 [<266.74 GiB] / in use: 3 [<266.74 GiB] / in no VG: 0 [0   ]

$ lsblk
sda                               8:0    0 931.5G  0 disk 
├─sda1                            8:1    0 244.1G  0 part /media/Data
├─sda2                            8:2    0 449.7G  0 part /media/Data2
├─sda3                            8:3    0   512B  0 part 
├─sda4                            8:4    0  99.6G  0 part 
│ └─fedora_localhost--live-home 253:1    0   190G  0 lvm  /home
├─sda5                            8:5    0  48.8G  0 part 
│ └─fedora_localhost--live-root 253:0    0  76.8G  0 lvm  /
└─sda6                            8:6    0  18.5G  0 part [SWAP]
sdb                               8:16   0 119.2G  0 disk 
├─sdb1                            8:17   0   953M  0 part /boot/efi
└─sdb2                            8:18   0 118.3G  0 part 
  ├─fedora_localhost--live-root 253:0    0  76.8G  0 lvm  /
  └─fedora_localhost--live-home 253:1    0   190G  0 lvm  /home
sr0                              11:0    1  1024M  0 rom  

Can I just pvcreate /dev/sdc and then pvmove /sda/sda4 /dev/sdc, pvmove /sda/sda5 /dev/sdc, pvmove /sda/sdb2 /dev/sdc? Or is there some more complicated procedure needed?

okThen
  • 23
  • 2

1 Answers1

0

Can I just pvcreate /dev/sdc and then pvmove /sda/sda4 /dev/sdc, pvmove /sda/sda5 /dev/sdc, pvmove /sda/sdb2 /dev/sdc?

Yes. And after, remove the empty PVs with vgreduce --all fedora_localhost-live

That is all.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32