quickreference:lvm2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
quickreference:lvm2 [2020/08/18 13:33] – rodolico | quickreference:lvm2 [2024/12/07 13:36] (current) – [Too Much Information] rodolico | ||
---|---|---|---|
Line 13: | Line 13: | ||
At this point, you can create a vg (Volume Group) using the pv. We'll call it " | At this point, you can create a vg (Volume Group) using the pv. We'll call it " | ||
- | <code bash>lvcreate | + | <code bash>vgcreate |
Now, you have a volume group " | Now, you have a volume group " | ||
Line 24: | Line 24: | ||
fdisk / | fdisk / | ||
mkfs.ext4 -m 0 -L testing / | mkfs.ext4 -m 0 -L testing / | ||
+ | </ | ||
+ | |||
+ | ===== 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 < | ||
+ | # now, tell it to release the lv's. If you do not specify a path | ||
+ | # releases everything | ||
+ | lvchange -an < | ||
+ | vgchange -an < | ||
</ | </ | ||
Line 31: | Line 45: | ||
<code python> | <code python> | ||
+ | # only check RAID volumes (/dev/md0), ignore everything else | ||
filter=[ " | filter=[ " | ||
+ | # only check /dev/sda, nothing else | ||
+ | filter = [ " | ||
+ | # Finally, accept sda, sdb, any md, then ignore anything else | ||
+ | filter = [ " | ||
+ | </ | ||
+ | |||
+ | To determine which drives are actually local, you can use the **mount** command. For example: | ||
+ | <code bash> | ||
+ | mount | grep ' | ||
+ | </ | ||
+ | will show all mounted drives which are local, ignoring nfs, tmpfs, etc... | ||
+ | |||
+ | After making the change, rescan LVM with one of the following commands | ||
+ | <code bash> | ||
+ | # yes, start, not reload, not restart, start | ||
+ | vgscan | ||
+ | # OR | ||
+ | service lvm2 start | ||
+ | # OR | ||
+ | lvm vgchange -aay --sysinit | ||
</ | </ | ||
Line 112: | Line 147: | ||
- You can view how " | - You can view how " | ||
- Make your changes. For example, if your snapshot is of a Xen virtual, start the virtual back up and make the system changes. | - Make your changes. For example, if your snapshot is of a Xen virtual, start the virtual back up and make the system changes. | ||
- | - Clean up. | ||
- If you have problems with the existing system, revert to the original | - If you have problems with the existing system, revert to the original | ||
- | | + | |
- | - Revert the original with the command< | + | - Revert the original with the command< |
- The parameter is the path to the snapshot. This will take all changes to the original and put them back in, then it will automatically delete the snapshot. | - The parameter is the path to the snapshot. This will take all changes to the original and put them back in, then it will automatically delete the snapshot. | ||
- If you had no problems and want the machine in the new state permanently, | - If you had no problems and want the machine in the new state permanently, | ||
- be sure you don't delete the wrong one, that is why I precede snapshots with " | - be sure you don't delete the wrong one, that is why I precede snapshots with " | ||
- | - Please note: running an LV with a snapshot decreases efficiency. | + | - Please note: running an LV with a snapshot decreases efficiency. |
Line 127: | Line 161: | ||
==== System ==== | ==== System ==== | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
==== Solution ==== | ==== Solution ==== | ||
- Shut down the DOMU | - Shut down the DOMU | ||
- | - <code bash> | + | - Increase LV to the size you want. This sets it to 100G<code bash> |
- | - <code bash> | + | |
- | - use the " | + | |
+ | - use the " | ||
- use the " | - use the " | ||
- use the " | - use the " | ||
Line 143: | Line 178: | ||
- Let the ending cylinder/ | - Let the ending cylinder/ | ||
- use the " | - use the " | ||
- | - use the " | + | - use the " |
- | - < | + | |
- Start the DOMU and log into it | - Start the DOMU and log into it | ||
- vgs # so we can see what we had | - vgs # so we can see what we had |
quickreference/lvm2.1597775636.txt.gz · Last modified: 2020/08/18 13:33 by rodolico