I want to copy my installation to a bigger SD-card. I read that i have to use the command dd, but am not sure how.
Someone can give the detailed steps (or a link to a how-to)?
Thanks
Re: copy install to new SD-card
Do you have a Windows box? Then it's even easier...
Download Win32DiskImager
Insert current SD card
Click read (it'll make a backup image)
Insert new SD card
Click write + select the backup image of old card
Download Win32DiskImager
Insert current SD card
Click read (it'll make a backup image)
Insert new SD card
Click write + select the backup image of old card
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge
Re: copy install to new SD-card
Won't there be a need to resize the partitions after using Win32DiskImager?
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.
The purpose of a little toe is to ensure you keep your furniture in the right place.
-
- Posts: 381
- Joined: Tue May 29, 2012 2:51 pm
- Location: Lincolnshire UK
Re: copy install to new SD-card
HiMortimer wrote:Won't there be a need to resize the partitions after using Win32DiskImager?
If you have expanded the partitions on the card you are copying it should be the same on the new card. When I copied mine the image was the size of the card ~8Gb in my case but I haven't got my new card to put it on so I can't be sure yet.
Cheers
Paul
Procrastination - The Thief of Time.
Re: copy install to new SD-card
The OP says he wants to copy the installation to a bigger SD-card, but no one is describing the full answer. The answers given so far will leave him with an working image the same as before, and the extra capacity of his new card unused. Is there a Windows solution for resizing the partitions as well. I am a Mac user myself, and use a Virtual Machine booting a live CD ISO of GParted.
Nadir, what other systems do you have available to you?
Nadir, what other systems do you have available to you?
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.
The purpose of a little toe is to ensure you keep your furniture in the right place.
Re: copy install to new SD-card
Use a program such as Win32DiskImager to read from one card and then write to another.
If the new card is bigger than the old card, expand the partition as shown at the end of this page
http://elinux.org/RPi_Easy_SD_Card_Setup
If the new card is bigger than the old card, expand the partition as shown at the end of this page
http://elinux.org/RPi_Easy_SD_Card_Setup
Re: copy install to new SD-card
Thanks.
I ain't got Windows
(i got it in VirtualBox, perhaps on some old machines too, but i barely use it. If in desperate need i could install it though -depending what more this thread will offer. If i must i can create a Windows installation). Else i mainly use Debian.
What i tried was the following, and i think it worked:
1) I took the new SD-card and followed the usual guide:
http://elinux.org/RPi_Easy_SD_Card_Setup
2) I inserted it in the raspberry pi, to make sure it boots.
3) I put the old SD-card back in the raspberry and booted it
4) I mounted the new SD-cared at /media/disk
5) I edited /etc/ssh/sshd_config at the raspberry and made it to:
allow root login
allow password authentication
set the port to 22
6) I used rsync, to copy the old installation to the new SD-card:
7) I plugged the new SD-card into the raspberry, booted it, and disabled root login and password authentication in /etc/ssh/sshd_config again.
To resize the partition to make use of all space i used gparted.
In short i did the following:
dd'ed a new Debian installation to the new SD-card, a usual "installation", described in the wiki
rsync'ed the old installation to the ext4-partition.
The bigger part of my headeaches comes from the fact that i don't fully understand arm and the need for a vfat partition yet:
/dev/mmcblk0p1 on /boot type vfat (rw)
If i use dd at all i usually copy commands from how-to's (like the how-to unzip and dd the debian image to a SD-card). That makes it two things i am not good with...
I ain't got Windows
(i got it in VirtualBox, perhaps on some old machines too, but i barely use it. If in desperate need i could install it though -depending what more this thread will offer. If i must i can create a Windows installation). Else i mainly use Debian.
What i tried was the following, and i think it worked:
1) I took the new SD-card and followed the usual guide:
http://elinux.org/RPi_Easy_SD_Card_Setup
2) I inserted it in the raspberry pi, to make sure it boots.
3) I put the old SD-card back in the raspberry and booted it
4) I mounted the new SD-cared at /media/disk
5) I edited /etc/ssh/sshd_config at the raspberry and made it to:
allow root login
allow password authentication
set the port to 22
6) I used rsync, to copy the old installation to the new SD-card:
Code: Select all
rsync -av --delete-after \
--exclude="/proc/*" \
--exclude="/lost+found/*" \
--exclude="/dev/*" \
--exclude="/mnt/*" \
--exclude="/media/*" \
--exclude="/sys/*" \
--exclude="/tmp/*" \
root@192.168.1.25:/ /media/disk
To resize the partition to make use of all space i used gparted.
In short i did the following:
dd'ed a new Debian installation to the new SD-card, a usual "installation", described in the wiki
rsync'ed the old installation to the ext4-partition.
The bigger part of my headeaches comes from the fact that i don't fully understand arm and the need for a vfat partition yet:
/dev/mmcblk0p1 on /boot type vfat (rw)
If i use dd at all i usually copy commands from how-to's (like the how-to unzip and dd the debian image to a SD-card). That makes it two things i am not good with...

Re: copy install to new SD-card
yes, I would like to make some copies of SD cards.
I want to have multiples SD cards for various things (like xmbc, LAMP stack, etc.)
right now I have a "master" SD. I edited the keyboard layout (default to german), SSH pubkey, wifi driver, etc. based on this setup I would like to install xmbc or LAMP stack.
thanks for any hints
I want to have multiples SD cards for various things (like xmbc, LAMP stack, etc.)
right now I have a "master" SD. I edited the keyboard layout (default to german), SSH pubkey, wifi driver, etc. based on this setup I would like to install xmbc or LAMP stack.
thanks for any hints
-
- Posts: 3
- Joined: Fri Jul 29, 2016 10:01 am
Re: copy install to new SD-card
I want to do this directly from the Pi. I have connected the other sd card to it. How would I copy over my whole system.(8gb -> 32gb)
Re: copy install to new SD-card
PiClone.
See here, under the heading SD card Copier: https://www.raspberrypi.org/blog/anothe ... -raspbian/
See here, under the heading SD card Copier: https://www.raspberrypi.org/blog/anothe ... -raspbian/
Re: copy install to new SD-card
For the latest Raspbian, there is an sd card to card backup program in the menu. You plug in any USB SD card adapter and copy. I have not used it.
For Linux, there is the disk utility named disks in Linux Mint. You copy the card to a disk image on your Linux PC then restore the disk image to the new card. The new card has to be the same size or larger.
You can use Gparted to resize the Ext4 partition. I use it to make the Ext4 partition smaller before backing up the card to an image. You can then trim the image and restore the image to a smaller card. I used that technique to move a system from my 16 GB card to one of my 8 GB cards.
The Raspbian admin utility will expand the Ext4 partition to fill the whole card. I do not have a Pi in front of me to find the name in the Raspbian menu. I have used that after copying an 8 GB card to 16 GB.
I perform these operations on my Linux desktop/notebooks because that is where I store the backups. I have performed the same operations on a Windows machine by booting a live Linux Mint from a USB stick. I also have a Raspbian with the same utilities installed and boot that occasionally. I am about to set up a Raspbian NAS with a couple of mirrored disks. I will put my Raspbian card backups there and perform all the card operations in Raspbian.
No need for Windows.
My one remaining use for Windows is Microsoft project and that is only because of a university stuck in a 1990s time warp.
For Linux, there is the disk utility named disks in Linux Mint. You copy the card to a disk image on your Linux PC then restore the disk image to the new card. The new card has to be the same size or larger.
You can use Gparted to resize the Ext4 partition. I use it to make the Ext4 partition smaller before backing up the card to an image. You can then trim the image and restore the image to a smaller card. I used that technique to move a system from my 16 GB card to one of my 8 GB cards.
The Raspbian admin utility will expand the Ext4 partition to fill the whole card. I do not have a Pi in front of me to find the name in the Raspbian menu. I have used that after copying an 8 GB card to 16 GB.
I perform these operations on my Linux desktop/notebooks because that is where I store the backups. I have performed the same operations on a Windows machine by booting a live Linux Mint from a USB stick. I also have a Raspbian with the same utilities installed and boot that occasionally. I am about to set up a Raspbian NAS with a couple of mirrored disks. I will put my Raspbian card backups there and perform all the card operations in Raspbian.
No need for Windows.

My one remaining use for Windows is Microsoft project and that is only because of a university stuck in a 1990s time warp.

Re: copy install to new SD-card
peterlite wrote:For the latest Raspbian, there is an sd card to card backup program in the menu. You plug in any USB SD card adapter and copy. I have not used it.
For Linux, there is the disk utility named disks in Linux Mint. You copy the card to a disk image on your Linux PC then restore the disk image to the new card. The new card has to be the same size or larger.
You can use Gparted to resize the Ext4 partition. I use it to make the Ext4 partition smaller before backing up the card to an image. You can then trim the image and restore the image to a smaller card. I used that technique to move a system from my 16 GB card to one of my 8 GB cards.
The Raspbian admin utility will expand the Ext4 partition to fill the whole card. I do not have a Pi in front of me to find the name in the Raspbian menu. I have used that after copying an 8 GB card to 16 GB.
I perform these operations on my Linux desktop/notebooks because that is where I store the backups. I have performed the same operations on a Windows machine by booting a live Linux Mint from a USB stick. I also have a Raspbian with the same utilities installed and boot that occasionally. I am about to set up a Raspbian NAS with a couple of mirrored disks. I will put my Raspbian card backups there and perform all the card operations in Raspbian.
No need for Windows.![]()
My one remaining use for Windows is Microsoft project and that is only because of a university stuck in a 1990s time warp.
+1
I used to use this method all the time. Simple, fast and (most importantly) not on Windows.
Kratos
I have posted mostly with a Pi 2 running either Ubuntu MATE, or Raspbian.
Re: copy install to new SD-card
Assuming a Linux PC, the following should do it.
as root
Plugin the SD card to your PC, you should see 3 devices appear in /dev/mmcblk0* two have p0 & p1 suffixes these are the partitions, the dev without the p suffix is the whole SD card + partition tables.
To copy the whole PI install to /tmp us dd with if= (in file) and of= (out file)
Then plugin your new SD card and run the reverse
The new SD card now has a copy of Linux on and will run when you plug it into a rpi.
To extend the partitions to the full size of the SD card use the pi itself.
- 7 Advanced Options
- A1 Expand filesystem
you will need to reboot after doing this, the next boot ix expands the FS / partition before mounting it.
as root
Plugin the SD card to your PC, you should see 3 devices appear in /dev/mmcblk0* two have p0 & p1 suffixes these are the partitions, the dev without the p suffix is the whole SD card + partition tables.
To copy the whole PI install to /tmp us dd with if= (in file) and of= (out file)
Code: Select all
sudo dd bs=4M if=/dev/mmcblk0 of=/tmp/pi.img
Code: Select all
sudo dd bs=4M if=/tmp/pi.img of=/dev/mmcblk0
To extend the partitions to the full size of the SD card use the pi itself.
Code: Select all
sudo raspi-config
- A1 Expand filesystem
you will need to reboot after doing this, the next boot ix expands the FS / partition before mounting it.
Re: copy install to new SD-card
The best way 100% was mentioned before, however was not clearly described.
1. ssh to your pi
2. run "sudo raspi-config"
3. Choose "advanced options"
4. select "expand filesystem"
Done, easy!
1. ssh to your pi
2. run "sudo raspi-config"
3. Choose "advanced options"
4. select "expand filesystem"
Done, easy!
Re: copy install to new SD-card
copy install to bigger (or smaller) microSD card..
I always use SD Card Copier in Raspbian Desktop... much easier with just a few clicks of the mouse.
I haven't tried it yet but there is a CLI version that is also available (not the dreaded "dd")
https://github.com/billw2/rpi-clone
I always use SD Card Copier in Raspbian Desktop... much easier with just a few clicks of the mouse.
I haven't tried it yet but there is a CLI version that is also available (not the dreaded "dd")
https://github.com/billw2/rpi-clone
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"
Re: copy install to new SD-card
Yes. The now built-in SD Card Copier is a good thing.LTolledo wrote: ↑Sat Aug 18, 2018 11:01 amcopy install to bigger (or smaller) microSD card..
I always use SD Card Copier in Raspbian Desktop... much easier with just a few clicks of the mouse.
I haven't tried it yet but there is a CLI version that is also available (not the dreaded "dd")
https://github.com/billw2/rpi-clone
But I think it is important to realize that what makes SD Card Copier a good thing is precisely the fact that it is doing a file-level copy (i.e., using file level commands like "cp") rather than an image-level copy (using commands like "dd").
I.e., SD Card Copier is just doing what sensible people have been recommending all along - namely, to do your backups via file-level copying rather than ditzing around with image level stuff.
"L'enfer, c'est les autres"
G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:
Epmu Sn!
J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!
G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:
Epmu Sn!
J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!
Re: copy install to new SD-card
Genius! The solution was there all the time!peterlite wrote: ↑Wed Aug 03, 2016 1:48 amFor the latest Raspbian, there is an sd card to card backup program in the menu. You plug in any USB SD card adapter and copy. I have not used it.
For Linux, there is the disk utility named disks in Linux Mint. You copy the card to a disk image on your Linux PC then restore the disk image to the new card. The new card has to be the same size or larger.
You can use Gparted to resize the Ext4 partition. I use it to make the Ext4 partition smaller before backing up the card to an image. You can then trim the image and restore the image to a smaller card. I used that technique to move a system from my 16 GB card to one of my 8 GB cards.
The Raspbian admin utility will expand the Ext4 partition to fill the whole card. I do not have a Pi in front of me to find the name in the Raspbian menu. I have used that after copying an 8 GB card to 16 GB.
I perform these operations on my Linux desktop/notebooks because that is where I store the backups. I have performed the same operations on a Windows machine by booting a live Linux Mint from a USB stick. I also have a Raspbian with the same utilities installed and boot that occasionally. I am about to set up a Raspbian NAS with a couple of mirrored disks. I will put my Raspbian card backups there and perform all the card operations in Raspbian.
No need for Windows.![]()
My one remaining use for Windows is Microsoft project and that is only because of a university stuck in a 1990s time warp.![]()
