Re: [Hampshire] Partition resizing

Top Page

Reply to this message
Author: Leo
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Partition resizing
Thanks for that.

In the end, because I failed to work out how to create the correct file
system on the first partition, I ended up dding the first gig of the
image to the card, then re-creating the second partition and rsyncing
the contents.

Appears to have worked as I can now ssh into it :) Which is good, as
I've just realised I have no USB keyboards!

Leo

On 22/07/12 08:22, Jonathan Hudson wrote:
> On Sun, 22 Jul 2012 00:49:55 +0100, Leo wrote:
>
> 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
> --------------------------------------------------------------
>



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