1

I have a lv(logical volume) which is a original source of another snapshot. And I wanna extend the lv with command 'lvextend' and the first try failed with error:

Snapshot origin volumes can be resized only while inactive

So I tried the second way with a command sequence.

1. unmount [mount_path]
2. deactive the device with command(lvchange -an [device_path])
3. lvextend [device_path]

then I get the error:

LV [device_namr] has open snapshot [snapshot_name]: not deactivating

What should I do, how can I extend a lv with snapshot exists?

TommyLike
  • 1,010
  • 11
  • 20

2 Answers2

1

You must deactivate your snapshot too, with command:

lvchange -an [snapshot_path]

and when both of volume and snapshot are inactive, you can extend your volume.

malioboro
  • 3,097
  • 4
  • 35
  • 55
scarface_90
  • 376
  • 2
  • 6
  • example: `lvchange -an /dev/vg0/snap-tmp-vm04.debian-disk` – rubo77 Sep 06 '17 at 00:25
  • But then how do I extend the volume that's mapped to `/`... Surely I can't just deactivate it – Hubro Oct 03 '18 at 14:29
  • @Hubro, you need to boot with another live OS to make that happen. for example, make a flash drive bootable with an Ubuntu desktop version and boot with that live OS, and then you can make any changes you want on the `/` disk – scarface_90 May 04 '22 at 13:39
0

You don't need to deactivate the volume that is mounted to / you can resize it to occupy the empty space on your disk while the volume is mounted mounted

  1. To deactivate your snapshot do
    lvchange -an /path/to/snapshot
  2. To extend the voulume that's mapped to / use the --resizefs option of lvextend