Ubuntu: How to dd from smaller SD to bigger?



Question:

I run out of memory (8GB) in one system, and I need to move the existing system to bigger memory (16GB). Details

  • /dev/disk4s1 is the input i.e. from where I want to get the data
  • /dev/disk2s1 is the sd-card where I want write

I unmount disk2s1, and run

sudo dd bs=1m if=/dev/disk4s1 of=/dev/disk2s1  

but I get

dd: /dev/disk4s1: Resource busy  

I unmount also /dev/disk2s1 but I get dd: /dev/disk4s1: No such file or directory. So I should not unmount the input.

Keeping both SD-cards unmounted, I run XtrmJosh's proposal sudo dd if=/dev/disk4s1 of=/dev/disk2s1 but get dd: /dev/disk4s1: No such file or directory.

System report of OSX (Sorry, my Ubuntu is upgrading slowly itself now) where I am uncertain if I dding right things. Command sudo dd if=/dev/disk4s2 of=/dev/disk2s1 is not correct also.

USB 3.0 Bus:      Capacity: 8,02 GB (8 017 412 096 bytes)    Removable Media:  Yes    BSD Name: disk4    Partition Map Type:   MBR (Master Boot Record)    PCI Device ID:    0x9c31     PCI Revision ID:  0x0004     PCI Vendor ID:    0x8086     Volumes:  boot:    Capacity: 62,9 MB (62 914 560 bytes)    Available:    42 MB (41 951 232 bytes)    Writable: Yes    File System:  MS-DOS FAT16    BSD Name: disk4s1    Mount Point:  /Volumes/boot    Content:  Windows_FAT_32    Volume UUID:  B39523D8-BEFC-3910-95CD-08A0C8F472AF  disk4s2:    Capacity: 3,96 GB (3 962 568 704 bytes)    BSD Name: disk4s2    Content:  Linux    Card Reader:      ...    Current Available (mA):   1800    Current Required (mA):    224    Extra Operating Current (mA): 0    Capacity: 15,93 GB (15 931 539 456 bytes)    Removable Media:  Yes    Detachable Drive: Yes    BSD Name: disk2    Built-In: Yes    Partition Map Type:   MBR (Master Boot Record)    Volumes:  NO NAME:    Capacity: 1,98 GB (1 975 546 368 bytes)    Available:    1,97 GB (1 972 600 832 bytes)    Writable: Yes    File System:  MS-DOS FAT16    BSD Name: disk2s1    Mount Point:  /Volumes/NO NAME    Content:  DOS_FAT_16    Volume UUID:  2AE73D94-DEE9-3B80-A4DA-0AF2B6449863    Mass Storage Device:      Product ID:   0x125c    Vendor ID:    0x14cd  (MOAI ELECTRONICS CORPORATION)    Version:  3.00    Serial Number:    125C20100726    Speed:    Up to 480 Mb/sec    Manufacturer: Generic    Location ID:  0x14200000 / 11    Current Available (mA):   1000    Current Required (mA):    248    Extra Operating Current (mA): 0    Capacity: 8,02 GB (8 017 412 096 bytes)    Removable Media:  Yes    Detachable Drive: Yes    BSD Name: disk4    Partition Map Type:   MBR (Master Boot Record)    Volumes:  boot:    Capacity: 62,9 MB (62 914 560 bytes)    Available:    42 MB (41 951 232 bytes)    Writable: Yes    File System:  MS-DOS FAT16    BSD Name: disk4s1    Mount Point:  /Volumes/boot    Content:  Windows_FAT_32    Volume UUID:  B39523D8-BEFC-3910-95CD-08A0C8F472AF  disk4s2:    Capacity: 3,96 GB (3 962 568 704 bytes)    BSD Name: disk4s2    Content:  Linux  

How can you dd from smaller SD-card to Bigger?


Solution:1

This appears to be an OS X question due to the disk names, but here is what you need to do:

diskutil unmountDisk /dev/disk4  diskutil unmountDisk /dev/disk2  sudo dd if=/dev/disk4 of=/dev/disk2 bs=1m  

The last line should work on Ubuntu and probably works on OS X as well. I just did something similar a couple weeks ago on a Raspberry Pi running Ubuntu Mate to rescue a buddy's Windows HDD data to a new drive. I don't recall having to unmount on Ubuntu, but it took forever to transfer about 150GB.

You can then follow the instructions here to resize your new partition to take advantage of the extra space.

Let me know if this works for you.


Solution:2

You can "dd from smaller SD-card to Bigger" but you will end up with the same partitions, e.g. disk space, as on the smaller SD card. Eventually you can create a new partition on the bigger SD card ending up with two partitions.

What you should do is to format the bigger SD card with full capacity and copy over the files form the smaller SD card.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »