TommyLike
TommyLike

Reputation: 1018

How to extend a logical volume which has snapshot on it

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?

Upvotes: 1

Views: 5307

Answers (2)

Abhikalp Unakal
Abhikalp Unakal

Reputation: 41

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

Upvotes: 0

scarface_90
scarface_90

Reputation: 386

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.

Upvotes: 1

Related Questions