fritserasmus Posted February 28, 2017 Share Posted February 28, 2017 I have a working system on 32 GB card that is just a bit slow. I now acquired a bigger and faster card so I just want to transfer EVERYTHING AS-IS to the new card. what is safest and fastest? Regards Frits Quote Link to comment Share on other sites More sharing options...
0 Guest Posted February 28, 2017 Share Posted February 28, 2017 Class 10 is what I am using http://www.takealot.com/samsung-64gb-evo-plus-micro-sd-card/PLID42074617 Quote Link to comment Share on other sites More sharing options...
0 ___ Posted February 28, 2017 Share Posted February 28, 2017 These two commands will do it on a unix (linux. OSX) machine: dd if=/dev/mmcblk0 bs=1M of=/tmp/image dd if=/tmp/image bs=1M of=/dev/mmcblk0 Of course there are some caveats. You have to swap the card in the middle. If the computer auto-mounts the card you will have to manually unmount it each time. And the new card needs to be at least as big as the old one, otherwise the end of the file system might be cut off. The other option is to partition it manually and copy the files using the cpio command (to preserve all permissions, hard links and sparseness where applicable). It's going to depend on what you have available to do the copy with. You should be able to use something like win32diskimager or windd to do the same thing as the unix commands... but if the new card is smaller (it happens, marketing decides to call it 32GB even though it is half a meg short) you're going to have an interesting time :-) Quote Link to comment Share on other sites More sharing options...
0 fritserasmus Posted March 1, 2017 Author Share Posted March 1, 2017 13 hours ago, Manie said: Class 10 is what I am using http://www.takealot.com/samsung-64gb-evo-plus-micro-sd-card/PLID42074617 @Maniethat is exactly what I ordered. Quote Link to comment Share on other sites More sharing options...
0 fritserasmus Posted March 1, 2017 Author Share Posted March 1, 2017 13 hours ago, plonkster said: These two commands will do it on a unix (linux. OSX) machine: dd if=/dev/mmcblk0 bs=1M of=/tmp/image dd if=/tmp/image bs=1M of=/dev/mmcblk0 Of course there are some caveats. You have to swap the card in the middle. If the computer auto-mounts the card you will have to manually unmount it each time. And the new card needs to be at least as big as the old one, otherwise the end of the file system might be cut off. The other option is to partition it manually and copy the files using the cpio command (to preserve all permissions, hard links and sparseness where applicable). It's going to depend on what you have available to do the copy with. You should be able to use something like win32diskimager or windd to do the same thing as the unix commands... but if the new card is smaller (it happens, marketing decides to call it 32GB even though it is half a meg short) you're going to have an interesting time :-) @plonksterI am lucky in the sense I am upgrading from 32 to 64Gb, but unlucky as I have to use windows. Can I use Etcher and put both cards in the PC and just etcher copy/burn? Quote Link to comment Share on other sites More sharing options...
0 ___ Posted March 1, 2017 Share Posted March 1, 2017 9 minutes ago, fritserasmus said: @plonksterI am lucky in the sense I am upgrading from 32 to 64Gb, but unlucky as I have to use windows. Can I use Etcher and put both cards in the PC and just etcher copy/burn? I have no idea, but you probably can. Just note: When you copy it in this manner, the filesystem will retain its original size. It will only use the first 32GB of the new larger card. To use the whole thing, you need to resize the filesystem with resize2fs, once again easy enough on a linux machine: fsck -f /dev/mmcblk0p2 resize2fs /dev/mmcblk0p2 The filesystem check is required, because resize2fs refuses to work on a filesystem that hasn't been checked first. You resize partition 2 (p2) because the first partition is a FAT partition that only holds the proprietary bootloader and the kernel and doesn't need to be made larger. Unfortunately you cannot resize the partition you're booted from, so this cannot be done on the Pi. Might be able to do it on the Pi if you have a USB-sdcard reader, but then the device won't be mmcblk0 of course :-) Quote Link to comment Share on other sites More sharing options...
0 fritserasmus Posted March 1, 2017 Author Share Posted March 1, 2017 22 minutes ago, plonkster said: I have no idea, but you probably can. Just note: When you copy it in this manner, the filesystem will retain its original size. It will only use the first 32GB of the new larger card. To use the whole thing, you need to resize the filesystem with resize2fs, once again easy enough on a linux machine: fsck -f /dev/mmcblk0p2 resize2fs /dev/mmcblk0p2 The filesystem check is required, because resize2fs refuses to work on a filesystem that hasn't been checked first. You resize partition 2 (p2) because the first partition is a FAT partition that only holds the proprietary bootloader and the kernel and doesn't need to be made larger. Unfortunately you cannot resize the partition you're booted from, so this cannot be done on the Pi. Might be able to do it on the Pi if you have a USB-sdcard reader, but then the device won't be mmcblk0 of course :-) That was all the pointers I needed. I have a friend with Linux on his LAPTOP. why laptop because it already has a SD Card reader, I have a SD Adapter and a Micro SD USB card reader so I just MIGHT be in luck!! I will let you guys know Quote Link to comment Share on other sites More sharing options...
0 ___ Posted March 1, 2017 Share Posted March 1, 2017 Apologies, I forgot that you also need to enlarge the partition itself! So you'd have to edit it in fdisk, print the current layout, then delete partition number 2 (don't worry, the data is still there). Then recreate it with the exact same start cylinder but accept the default offered as end cylinder (which should allocate all remaining space to partition 2). Then fsck the filesystem and resize2fs it. Resize2fs will automatically use all the available space. Yes, I know that the command to check a file system is dangerously close to another 4-letter word. In fact, it's a running joke inside the unix community. We have several of those, including also unzip, touch, yes, mount, and even sleep. :-P Quote Link to comment Share on other sites More sharing options...
0 SilverNodashi Posted March 1, 2017 Share Posted March 1, 2017 It's a bit easier to use Win32imager. Dump the current SD card to your PC, and then re-image it to a new SD card ___ 1 Quote Link to comment Share on other sites More sharing options...
0 fritserasmus Posted March 2, 2017 Author Share Posted March 2, 2017 @silvernodashi, I think I am going to try that first and if it fails do the Linux Sent from my EVA-L19 using Tapatalk Quote Link to comment Share on other sites More sharing options...
0 fritserasmus Posted April 6, 2017 Author Share Posted April 6, 2017 Windows worked first time. Easy PeasySent from my EVA-L19 using Tapatalk Quote Link to comment Share on other sites More sharing options...
Question
fritserasmus
I have a working system on 32 GB card that is just a bit slow. I now acquired a bigger and faster card so I just want to transfer EVERYTHING AS-IS to the new card.
what is safest and fastest?
Regards
Frits
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.