Welcome to AUXNET IRC Network




Idle on AUXnet a lot? Why not play our idlerpg game, you can check it out at #idleRPG - for more information visit the website http://idlerpg.auxnet.org

Mount an LVM partition image cloned with dd

Attention: open in a new window. PDFPrintE-mail

The mount procedure below use the loop0 device, check that its free with

[[email protected] Scaricati]# losetup --all
[[email protected] Scaricati]#

otherwise use loop1/2/3…

CHECK IMAGE

[[email protected] Scaricati]# file backup-cloud.img
backup-cloud.img: LVM2 PV (Linux Logical Volume Manager), UUID: NiSuLv-fH2Z-eO4H-JoJ2-9yuG-fWvW-gmuJak, size: 10212081664
[[email protected] Scaricati]# fdisk -l backup-cloud.img

Disk backup-cloud.img: 10.2 GB, 10212040704 bytes, 19945392 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[[email protected] Scaricati]#

MOUNT:

[[email protected] Scaricati]# losetup /dev/loop0 backup-cloud.img
[[email protected] Scaricati]# pvs
  PV         VG   Fmt  Attr PSize PFree
  /dev/loop0 vg   lvm2 a--  9,51g    0
[[email protected] Scaricati]# vgchange -a y vg
  2 logical volume(s) in volume group "vg" now active
[[email protected] Scaricati]# mount -o ro /dev/vg/lv_root /mnt/old/
[[email protected] Scaricati]#

UMOUNT:

[[email protected] Scaricati]# umount /mnt/old/
[[email protected] Scaricati]# vgchange -a n vg
  0 logical volume(s) in volume group "vg" now active
[[email protected] Scaricati]# losetup -d /dev/loop0