Forum
[SOLVED] Clone SD to larger SD - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: [SOLVED] Clone SD to larger SD (/thread-4010.html)



Clone SD to larger SD - griv - 11th Jan, 2019 11:08 PM

Due to size constraints I've purchased a larger SD card than I currently use, and am hoping to simply copy the full contents of the SD card to my new larger SD card. I've read the wiki and forum and found a few different options (use dd, win32diskimager, xbian-config) but am a bit confused as to which one is suitable for me.

If I load the SD into my linux laptop I can see two drives, xbian and xbianboot.
If I load the SD into windows it shows as multiple drives all unreadable except for xbianboot.

Would the easiest way be to run win32diskimager and copy the readable drive and write this to the new SD? I've read that win32diskimager should copy the full SD contents even though multiple drives are shown, and that xbian will resize the partition on startup. So this seems like the best option?

Thanks in advance.


RE: Clone SD to larger SD - Skywatch - 12th Jan, 2019 12:58 AM

Xbian has it's own helpful copier built in!

If you type xbian-config in a shell window or via ssh, you will see options for backup and copying. One option is to copy entire system to usb.

You can also use win32diskimager, I have used this in the past without issues. So it's up to you. Keep your original copy until you know the new image is working OK.

Also note that windows will not be able to display the linux partitions on the SD card and that is why there is a difference in what you see between that and linux.

Note that whichever method you choose you MUST copy all partitions on the SD card to the new one. It should then resize the card on first boot for the bigger space available.


RE: Clone SD to larger SD - Nachteule - 12th Jan, 2019 02:12 AM

The best way to do it is (as Skywatch already told):

1) mount a share to your windows box
2) run sudo xbian-config, select 6) XBian copier
3) change destination to file:/<ThePathYouMounted>/backup.img. This makes a full backup of your sd-card
4) Now you can flash your image to new sd-card with the disk imager of your choice
5) Plug this card into your Pi and boot from it. Resizing root and creating swap will be done on the first boot automatically


RE: Clone SD to larger SD - griv - 16th Jan, 2019 02:29 AM

Thank you for the quick help! I've done as you instructed and all works fine, except that the filesystem doesn't seem to have resized. I did try to do the config -> settings -> system -> resize SD but it said the functionality has been disabled.

using df -h and btrfs filesystem df / show the size of the old card (32gb) instead of the new size (128gb)

Data, single: total=29.04GiB, used=1.35GiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=376.00MiB, used=59.20MiB
GlobalReserve, single: total=16.00MiB, used=0.00B


RE: Clone SD to larger SD - Nachteule - 16th Jan, 2019 03:37 AM

Tell me, what exactly did you do?

Resizing will be done in the initramfs routines, so if not enabled, you have to enable initramfs

Pls show me output of

Terminal

sudo fdisk -l /dev/mmcblk0



RE: Clone SD to larger SD - griv - 16th Jan, 2019 04:28 AM

I turned off the raspberry, inserted the old SD into my windows laptop and used win32diskimager to create a copy of the SD, and saved this .img to my laptop. I then inserted the new SD card and used win32diskimager to clone this .img onto the new SD. Everything boots fine and it works okay.

I used win32diskimager as I was having trouble mounting drives on the raspberry.

Terminal
xbian@xbian ~ $ sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 119.1 GiB, 127865454592 bytes, 249737216 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
Disklabel type: dos
Disk identifier: 0xd66fd072

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 141311 139264 68M b W95 FAT32
/dev/mmcblk0p2 141312 61832191 61690880 29.4G 83 Linux
/dev/mmcblk0p3 61833216 62333951 500736 244.5M 82 Linux swap / Solaris



RE: Clone SD to larger SD - Nachteule - 17th Jan, 2019 03:48 AM

So it does not wondering why you still have 32GB. You did not that what we described, you just made a 1:1 copy of your 32GB sd-card

So, you can do following steps now:

1) you have to remove partition 3 (this is the swap partition)
1.1) run sudo swapoff -a
1.2) run sudo fdisk /dev/mmcblk0 and delete partition 3. Don't forget to save changes by running 'w' command

2) make sure that initramfs is enabled, this can be set in Kodis XBian-config GUI, Category System
3) reboot

While system starts again, root partition will be enlarged and new swap partition will be created


RE: Clone SD to larger SD - griv - 17th Jan, 2019 05:52 AM

Thank you so much, all is working now with the correct size. My apologies for not following instructions, I just couldn't get my windows mount working correctly on the raspberry.

Thanks as always for such good software and amazing support!


RE: Clone SD to larger SD - Nachteule - 17th Jan, 2019 05:54 AM

Thanks for your response, set this thread as solved