1

I have a very specific kernel structure on an sd card I'd like to copy and send to a friend.

I know I can simply dd the entire SD card, but the kernel is ~2GB, which wastes the other 14GB of the disk.

Is there a way to dd just the important parts?

I know I can also dd the individual partitions, but this requires setting up an equivalent partition table on the other side, so I'd prefer to do this in a way that requires only a single dd to the child disk, regardless of the complexity of creating the parent.

  • dd copies blocks of amorphous data. It looks as if you wanted to copy files. – AlexP Dec 01 '17 at 04:01
  • Yeah I'm aware DD doesn't look at the data, I was wondering if there was some trick with getting the size from the devices and using that as an argument to dd – Brydon Gibson Dec 01 '17 at 04:06
  • To repeat, dd copies blocks of data. It has no idea of a filesystem. What makes you think that the files you want to copy are contiguous and placed at a well-known place on the disk? – AlexP Dec 01 '17 at 04:14
  • Ah good point, I forgot that journaling systems put the files everywhere. I guess my question then is would rsync or even just tar/send over the net be adapted (with other applications as well) to work across partitions? – Brydon Gibson Dec 01 '17 at 04:16
  • I don't know, never tried. Why don't you send the recipe for making that kernel structure? Presumably your kernel structure is made by running a script or set of commands. – AlexP Dec 01 '17 at 04:23

1 Answers1

2

You can try Clonezilla,

http://clonezilla.org

  • Download a Clonezilla iso file, make a CD boot disk or USB boot drive and boot from it.

  • Create a compressed image of the whole drive (a Clonezilla image is a directory with a number of files, where the big files are compressed). Clonezilla is smart enough to only clone the used blocks (and skip blocks, that are not used).

  • Test that it works to restore from the image, and when you know that it works, you can send the image to your friend.

sudodus
  • 46,324
  • 5
  • 88
  • 152