Re: [Hampshire] Partition resizing

Top Page

Reply to this message
Author: Jonathan Hudson
Date:  
To: hampshire
Subject: Re: [Hampshire] Partition resizing
On Sun, 22 Jul 2012 00:49:55 +0100, Leo wrote:

>
>So Jonathan, perhaps I'll try your suggestion instead; as soon as I've
>found out what qemu-nbd does :)



qemu-nbd uses the network block device (modprobe nbd max_part=8) to
crate mountable device nodes from a disk image, either a raw disk image
or a VM disk image (qcow, vmdk, vdi at least). So it's useful for fixing
VM images as well.

Otherwise you could use the loop back device and kpartx:

# losetup -f --show archlinuxarm-13-06-2012.img
/dev/loop0
# kpartx -a /dev/loop0 ### <- loop device reported by losetup
# new device nodes under /dev/mapper ....
# mount /dev/mapper/loop0p1 /mnt/b
# mount /dev/mapper/loop0p2 /mnt/r
# ### copy / rsync from /mnt/b and /mnt/r to sd boot and root
# ### clean up
# umount /dev/mapper/loop0p1
# umount /dev/mapper/loop0p2
# kpartx -d /dev/loop0
# losetup -d /dev/loop0

--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------