Created
March 25, 2014 03:05
-
-
Save tobert/9754543 to your computer and use it in GitHub Desktop.
Throw together a quick LVM config for dumping the device mapper table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create empty volume files | |
truncate --size 256M /a | |
truncate --size 256M /b | |
# attach them to loopback devices | |
deva=$(losetup --find) | |
losetup $deva /a | |
devb=$(losetup --find) | |
losetup $devb /b | |
# format as LVM physical volumes | |
pvcreate $deva | |
pvcreate $devb | |
# create the volume group | |
vgcreate test $deva $devb | |
# create a mirrored (RAID1) logical volume with an in-memory replication log | |
lvcreate --extents 1 --mirrors 1 --corelog --name lv_derp test | |
dmsetup table /dev/mapper/test-lv_derp | |
# 0 8192 mirror core 1 1024 2 253:0 0 253:1 0 1 handle_errors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment