Line 17: |
Line 17: |
| Step 3: Stop the snapshot device and merge the snapshot with the base | | Step 3: Stop the snapshot device and merge the snapshot with the base |
| <nowiki>dmsetup suspend top | | <nowiki>dmsetup suspend top |
− | echo 0 $(blockdev --getsize /dev/loop2) snapshot-merge /dev/loop2 /dev/loop3 p 8 | dmsetup create mergeomatic && dmsetup status mergeomatic | + | echo 0 $(blockdev --getsize /dev/loop2) snapshot-merge /dev/loop2 /dev/loop3 p 8 | dmsetup create mergeomatic && dmsetup status mergeomatic</nowiki> |
− | dmsetup status
| |
− | dmsetup remove mergeomatic</nowiki>
| |
| | | |
− | Step 4: Set the top device to no snapshot, and inspect the filesystem for results, if desired. | + | Step 4: Wait for merge to complete. When the status report on mergeomatic reports allocated blocks equal to the metadata blocks, the merge is finished. |
| + | dmsetup status |
| + | |
| + | Step 5: Remove the merge target. |
| + | dmsetup remove mergeomatic |
| + | |
| + | Step 6: Set the top device to no snapshot, and inspect the filesystem for results, if desired. |
| <nowiki>echo 0 $(blockdev --getsize /dev/loop2) linear /dev/loop2 0 | dmsetup load top | | <nowiki>echo 0 $(blockdev --getsize /dev/loop2) linear /dev/loop2 0 | dmsetup load top |
| dmsetup resume top | | dmsetup resume top |
Line 29: |
Line 33: |
| chroot .</nowiki> | | chroot .</nowiki> |
| | | |
− | Step 5: Clean up. | + | Step 7: Clean up. |
| <nowiki>cd .. | | <nowiki>cd .. |
| umount root | | umount root |
Line 38: |
Line 42: |
| umount squashfs/</nowiki> | | umount squashfs/</nowiki> |
| | | |
− | Step 6: Copy the root filesystem image back into the squashfs image, you may need -noappend | + | Step 8: Copy the root filesystem image back into the squashfs image, you may need -noappend |
| <nowiki>mkdir LiveOS | | <nowiki>mkdir LiveOS |
| mv ext3fs.img LiveOS | | mv ext3fs.img LiveOS |
| rm /run/media/*/LIVE/LiveOS/squashfs.img | | rm /run/media/*/LIVE/LiveOS/squashfs.img |
| mksquashfs LiveOS /run/media/*/LIVE/LiveOS/squashfs.img -keep-as-directory</nowiki> | | mksquashfs LiveOS /run/media/*/LIVE/LiveOS/squashfs.img -keep-as-directory</nowiki> |
| + | |
| + | Sources: <br> |
| + | *http://smorgasbord.gavagai.nl/2010/03/online-merging-of-cow-volumes-with-dm-snapshot <br> |
| + | *http://www.kernel.org/doc/Documentation/device-mapper/snapshot.txt<br> |
| + | *http://linuxgazette.net/114/kapil.html<br> |
| + | |
| + | --[[User:Andrew Gilmore|Andrew Gilmore]] |