Re: how to convert a disk containing a snapshot to a snapshot lv?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm confused.  What exactly are you trying to do here?  I can't think of
any reason why you would want to copy a snapshot lv to a file then try
to loop mount it.

Tomas Dalebjörk <tomas.dalebjork@xxxxxxxxx> writes:

> Hi,
>
> I am trying to understand how to convert a disk containing snapshot data.
> This is how I tested this:
> 1. locate the snapshot testlv.211218.232255
> root@debian10:/dev/mapper# lvs
>   LV                   VG          Attr       LSize   Pool Origin Data%
>  Meta%  Move Log Cpy%Sync Convert
>   home                 debian10-vg -wi-ao----   1.00g
>   root                 debian10-vg -wi-ao----  <3.81g
>   swap_1               debian10-vg -wi-ao---- 976.00m
>   testlv               debian10-vg owi-aos--- 100.00m
>   testlv.211218.232255 debian10-vg swi-a-s--- 104.00m      testlv 1.44
> root@debian10:/dev/mapper#
>
> 2. copy the lv - cow data to a file
> # dd if=/dev/mapper/debian10--vg-testlv.211218.232255-cow of=/tmp/out
> bs=1024
>
> 3. Setup a loopback disk for the file
> # losetup -fP /tmp/out
>
> 4. Verify that disk exists
> root@debian10:/dev/mapper# losetup -a
> /dev/loop0: [65025]:39274 (/tmp/out)
> root@debian10:/dev/mapper#
>
> 5. Try converting the disk using lvconvert command
> # lvconvert -Zn -s debian10-vg/testlv /tmp/out
>   "/tmp/out": Invalid path for Logical Volume.
>
> 6. Trying creating a softlink in /dev/mapper
> # ln -s /tmp/out debian10--vg-loopback
>
> 7. verify link
> root@debian10:/dev/mapper# ls -la
> total 0
> drwxr-xr-x  2 root root     240 Dec 19 17:40 .
> drwxr-xr-x 18 root root    3820 Dec 19 17:22 ..
> crw-------  1 root root 10, 236 Dec 10 19:10 control
> lrwxrwxrwx  1 root root       7 Dec 10 19:10 debian10--vg-home -> ../dm-5
> lrwxrwxrwx  1 root root       8 Dec 19 17:40 debian10--vg-loopback ->
> /tmp/out
> lrwxrwxrwx  1 root root       7 Dec 13 22:20 debian10--vg-root -> ../dm-1
> lrwxrwxrwx  1 root root       7 Dec 10 19:10 debian10--vg-swap_1 -> ../dm-4
> lrwxrwxrwx  1 root root       7 Dec 18 23:23 debian10--vg-testlv -> ../dm-0
> lrwxrwxrwx  1 root root       7 Dec 18 23:23
> debian10--vg-testlv.211218.232255 -> ../dm-6
> lrwxrwxrwx  1 root root       7 Dec 18 23:23
> debian10--vg-testlv.211218.232255-cow -> ../dm-3
> lrwxrwxrwx  1 root root       7 Dec 18 23:23 debian10--vg-testlv-real ->
> ../dm-2
> root@debian10:/dev/mapper#
>
> 8. retrying lvconvert command
> root@debian10:/dev/mapper# lvconvert -Zn -s debian10-vg/testlv
> /dev/mapper/debian10--vg-loopback
>   Failed to find logical volume "debian10-vg/loopback"
> root@debian10:/dev/mapper#
>
> Are there more things to be considered, such as recreating pv data on disk?
>
> Regards Tomas
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@xxxxxxxxxx
> https://listman.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


_______________________________________________
linux-lvm mailing list
linux-lvm@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux