User Tools

Site Tools


quickreference:lvm2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
quickreference:lvm2 [2020/08/18 14:24] rodolicoquickreference:lvm2 [2023/10/15 00:11] (current) – [Testing a change with ability to revert] rodolico
Line 24: Line 24:
 fdisk /dev/vg0/testing fdisk /dev/vg0/testing
 mkfs.ext4 -m 0 -L testing /dev/vg0/testing mkfs.ext4 -m 0 -L testing /dev/vg0/testing
 +</code>
 +
 +===== Make it Stop =====
 +
 +Well, lvm really, really wants to make sure your stuff is there, even it the underlying volume is renamed, or even reformatted. Even after you remove the lv's, the vg's and the pv's, sometimes you still can not get it to do anything
 +
 +<code bash>
 +# sometimes helpful to remove the dm's first, but not always necessary
 +dmsetup ls
 +dmsetup remove <name>
 +# now, tell it to release the lv's. If you do not specify a path
 +# releases everything
 +lvchange -an <lvpath>
 +vgchange -an <vgname>
 </code> </code>
  
Line 118: Line 132:
   - If you had no problems and want the machine in the new state permanently, remove the snapshot with<code bash>lvremove /dev/vg0/snap.virt</code>   - If you had no problems and want the machine in the new state permanently, remove the snapshot with<code bash>lvremove /dev/vg0/snap.virt</code>
     - be sure you don't delete the wrong one, that is why I precede snapshots with "snap"     - be sure you don't delete the wrong one, that is why I precede snapshots with "snap"
-    - Please note: running an LV with a snapshot decreases efficiency. Any writes to the original generate a write to the snapshot, so you are decreasing disk access speed greatly. Don't leave spare snapshots laying around past the time you need them,+    - Please note: running an LV with a snapshot decreases efficiency. Many (most?writes to the original generate a write to the snapshot, so you are decreasing disk access speed greatly. Don't leave spare snapshots laying around past the time you need them,
  
  
Line 135: Line 149:
   - Increase LV to the size you want. This sets it to 100G<code bash>lvresize -L 100G /dev/virtuals/my_domu-disk1</code>   - Increase LV to the size you want. This sets it to 100G<code bash>lvresize -L 100G /dev/virtuals/my_domu-disk1</code>
   - Manually edit partition table to "grow" the partition. NOTE: I'm lazy, so I use the bootable [[https://gparted.sourceforge.io/|gparted Live ISO]] most of the time, but this is how you do it manually   - Manually edit partition table to "grow" the partition. NOTE: I'm lazy, so I use the bootable [[https://gparted.sourceforge.io/|gparted Live ISO]] most of the time, but this is how you do it manually
-    - <code bash>fdisk /dev/virtuals/my_domu-disk1<code>+    - <code bash>fdisk /dev/virtuals/my_domu-disk1</code>
     - use the "p" command to see what the partition number and type is and, most importantly, what its starting cylinder/sector/whatever is. You must record this info. If it is bootable (unlikely), you will need that also.     - use the "p" command to see what the partition number and type is and, most importantly, what its starting cylinder/sector/whatever is. You must record this info. If it is bootable (unlikely), you will need that also.
     - use the "d" command to delete the partition.     - use the "d" command to delete the partition.
quickreference/lvm2.1597778653.txt.gz · Last modified: 2020/08/18 14:24 by rodolico