Last active
January 16, 2023 14:32
-
-
Save jowagner/b36024636140ddf453c12eaf6e590b5d to your computer and use it in GitHub Desktop.
Make snapshot of non-busy block device with device mapper in Linux
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
NAME=nameofsnapshot | |
DEVRO=/dev/read-only-backing-device | |
DEVCOW=/dev/space-for-writing-changes | |
SECTORS=$(blockdev --getsz $DEVRO) | |
TABLE=$(mktemp) | |
echo 0 $SECTORS snapshot $DEVRO $DEVCOW N 16 >> $TABLE | |
echo "Setting up $NAME with" | |
head $TABLE | |
dmsetup create $NAME < $TABLE | |
rm $TABLE |
hwk
commented
Dec 22, 2022
via email
Hi Joachim,
thank's a lot, it now works.
Kind regards & seasons greetings, Hans
On 21.12.2022 14:23, Joachim Wagner wrote:
@jowagner commented on this gist.
-------------------------
Thanks for reporting the issue. Trying it with and without mounting the
backing device I get the same error message when the device is mounted,
suggesting that dmsetup create cannot use mounted block devices. "Busy"
probably also applies to other scenarios such as the backing device
being part of an active software RAID. Will update the description.
--
Reply to this email directly, view it on GitHub [1] or unsubscribe [2].
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS [3] or
Android [4].
Links:
------
[1]
https://gist.github.com/b36024636140ddf453c12eaf6e590b5d#gistcomment-4409784
[2]
https://github.com/notifications/unsubscribe-auth/AAGQM4K5QXJQRL7XZLT2G2LWOMAFLBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTCMRYGE4TINZWU52HE2LHM5SXFJTDOJSWC5DF
[3]
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
[4]
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment