I think that's what I'm slowly heading towards. I've created the
partitions on the sd card but then the copying fails even though the
partitions seem to be the same size:
$ fdisk -lu archlinuxarm-13-06-2012.img
Disk archlinuxarm-13-06-2012.img: 1977 MB, 1977614336 bytes
255 heads, 63 sectors/track, 240 cylinders, total 3862528 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
Disk identifier: 0x000c21e5
Device Boot Start End Blocks
Id System
archlinuxarm-13-06-2012.img1 * 2048 194559 96256
c W95 FAT32 (LBA)
archlinuxarm-13-06-2012.img2 194560 3862527 1833984
83 Linux
AND
$ sudo fdisk -lu /dev/sdg
Disk /dev/sdg: 1015 MB, 1015808000 bytes
32 heads, 61 sectors/track, 1016 cylinders, total 1984000 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
Disk identifier: 0xd44f2f86
Device Boot Start End Blocks Id System
/dev/sdg1 * 2048 194559 96256 c W95 FAT32 (LBA)
/dev/sdg2 194560 1983999 894720 83 Linux
However:
$ sudo dd bs=1M if=/dev/loop0 of=/dev/sdg1
dd: writing `/dev/sdg1': No space left on device
95+0 records in
94+0 records out
98566144 bytes (99 MB) copied, 10.2177 s, 9.6 MB/s
Seems to indicate they're not the same size after all??
So Jonathan, perhaps I'll try your suggestion instead; as soon as I've
found out what qemu-nbd does :)
Leo
On 21/07/12 19:01, Jonathan Hudson wrote:
> On Sat, 21 Jul 2012 18:40:45 +0100, Leo wrote:
>
>> I've downloaded ArchLinux for the Raspberry Pi, but it's a 2GB image.
>> I've a 1GB SD, which the content should fit on, so I'm trying to resize it.
>>
>> I've now got to the point where I can create an image file with two
>> partitions totalling 1GB that mount fine. But after I've dd-ed it to the
>> SD card I can't mount either of the partitions on the SD card.
>>
>> Leo
>
> In my experience, it's easier to mount the image and then recreate on
> the media e.g: (and from second glass of wine memory, so check .... )
>
> # qemu-nbd -c /dev/nbd0 $(pwd)/archlinuxarm-13-06-2012.img
> # mount /dev/nbd0p2 /mnt/
> # mount /dev/nbd0p1 /mnt/boot/
> # #### format the SD card for /boot and /
> # #### mount the SD card partitions
> # rsync -ax --numeric-ids /mnt/boot/ /sdp1-mount/
> # rsync -ax --numeric-ids /mnt/ sdp2-mount/
>
> worked for me for Arch, Debian, Raspian images.
>
> and df -hT:
>
> Filesystem Type Size Used Avail Use% Mounted on
> /dev/nbd0p2 ext4 1.8G 505M 1.2G 30% /mnt
>
> So, yes 1G SD should be fine.
>
> -jh
>
> --
> 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
--------------------------------------------------------------