I'd like to transfer my rpi debian syatem from a 8 Gb sd card to a 4Gb card.
Any pointers on how to do this?
Re: Downsize Debian image
Du you use a linux or windows machine to write your SD-cards ?
Re: Downsize Debian image
if linux just run gparted to resize your file system partition (it'll be the larger one), no idea how on windows or mac i'm afraid
then just dd if=<for each sd partition> of=<somefilename> for both your partitions then dd them back across to the new sd card at a guess
then just dd if=<for each sd partition> of=<somefilename> for both your partitions then dd them back across to the new sd card at a guess
Re: Downsize Debian image
I use win32duskimager. I can boot my machine with ubuntu, but I'm not an expert!topguy wrote:Du you use a linux or windows machine to write your SD-cards ?
Re: Downsize Debian image
can probably run gparted on the pi itself to resize the bigger partition, not sure how you'd then transfer these partitions to a smaller card, unless you plug the card into the pi using a usb card reader
I've only done pi card stuff with my opensuse machine I'm afraid, Windows is my primary OS but it just seemed easier the other way, I'm sure someone will know
I've only done pi card stuff with my opensuse machine I'm afraid, Windows is my primary OS but it just seemed easier the other way, I'm sure someone will know
Re: Downsize Debian image
I think you can only run gparted on a partition that isn't mounted.
So, running ubuntu on your pc, connecting the sd card and unmounting the partition should work.
You can shrink the partition with gparted, and copy it with dd.
So, running ubuntu on your pc, connecting the sd card and unmounting the partition should work.
You can shrink the partition with gparted, and copy it with dd.
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: Downsize Debian image
If I were doing this, I'd just do it the old-fashioned way:
0) Connect the USB card reader to the Pi and boot the Pi.
1) Setup the target card (fdisk, mke2fs)
2) Use "cp -a" to copy the files from the FAT partition to the card
3) Use "cp -a" to copy the files from the ext4 partition to the card
0) Connect the USB card reader to the Pi and boot the Pi.
1) Setup the target card (fdisk, mke2fs)
2) Use "cp -a" to copy the files from the FAT partition to the card
3) Use "cp -a" to copy the files from the ext4 partition to the card
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: Downsize Debian image
Sorry, I didn't make clear, I've only one (built-in) SD card reader.Joe Schmoe wrote:If I were doing this, I'd just do it the old-fashioned way:
0) Connect the USB card reader to the Pi and boot the Pi.
1) Setup the target card (fdisk, mke2fs)
2) Use "cp -a" to copy the files from the FAT partition to the card
3) Use "cp -a" to copy the files from the ext4 partition to the card
Re: Downsize Debian image
in that case log into ubuntu and run gparted on your sd card ("fdisk -l" will show you what drive you're looking for), make sure you make your filesystem (larger partition) as small as it can get, within reason, maybe a few hundred meg over what's in use, as your new sd card won't be EXACTLY 4gb
after resizing the drive go into a directory and type
dd if=/dev/sdd1 (for example, depending on your drive name) of=boot (or some descriptive name)
dd if=/dev/sdd2 of=filesystem
then put in your 4gb card and switch the if and of values listed above around, run gparted again and expand your filesystem partition to fill your new card
that oughta do it i think, if I'm wrong someone can correct me but it should at least give you a basic idea of what'll be involved
after resizing the drive go into a directory and type
dd if=/dev/sdd1 (for example, depending on your drive name) of=boot (or some descriptive name)
dd if=/dev/sdd2 of=filesystem
then put in your 4gb card and switch the if and of values listed above around, run gparted again and expand your filesystem partition to fill your new card
that oughta do it i think, if I'm wrong someone can correct me but it should at least give you a basic idea of what'll be involved