Page 1 of 1
dd 8Gb image onto 4Gb SD
Posted: Fri May 31, 2013 10:58 am
by Altin
I have Raspbian installed on an 8Gb SD card & it only uses about 2 - 3 Gb of size on the card. I have created an image of this card using 'dd' which is obviously 8Gb in size. Is it possible for me to dd this image onto a 4Gb card now as there is less than 4Gb of actual data, the rest being empty space? I want to use the 8Gb card to test other distros but still be able to simply plug back in my main OS when done.
Re: dd 8Gb image onto 4Gb SD
Posted: Fri May 31, 2013 11:08 am
by RaTTuS
a couple of ways
ether shrink the partition 1st then dd the partition and not the drive
or
setup another SD card like you want and
the large image to the smaller one
Re: dd 8Gb image onto 4Gb SD
Posted: Mon Jun 03, 2013 10:27 pm
by Altin
What arguments do I use if using rsync? There seems to be tons of options in the man page.
Re: dd 8Gb image onto 4Gb SD
Posted: Tue Jun 04, 2013 4:26 am
by SirLagz
Did you resize the second partition on the 8gb SD card ?
Re: dd 8Gb image onto 4Gb SD
Posted: Tue Jun 04, 2013 7:42 am
by Altin
I expanded it using raspi-config to use the whole 8Gb card.
Re: dd 8Gb image onto 4Gb SD
Posted: Tue Jun 04, 2013 8:18 am
by RaTTuS
rsync -ax / user@destmachine:/path/to/basic/image
meaning
do everything and don't cross filesystem boundaries
if you put the new SD card into the existing RPi with an USB sd card adapter you can
sudo mount /dev/sda1 /mnt
sudo rsync -vax / /mnt
[v is verbose]
Re: dd 8Gb image onto 4Gb SD
Posted: Tue Jun 04, 2013 12:21 pm
by Altin
Can this be run from the Raspi itself, i.e. to create an image on an external USB HDD, from the Raspi, would I run rsync -ax / /media/usb0/raspbian.img? I can use a linux live cd on my laptop & plug the SD card into it if not.
Also Raspbian creates 2 partitions on the SD card, /dev/mmcblkp01 & /dev/mmcblkp02 (from fdisk -l). If the -x flag doesnt cross the partition boundary does this mean you dont need both partitions, just the larger one with all the data?