[Cialug] dd only allocated space?

Zachary Kotlarek zach at kotlarek.com
Fri Jul 28 23:37:35 UTC 2017


On 28 Jul 2017, at 12:53, L. V. Lammert wrote:

>> If the space you want it contiguous you can just find the last block you
>> need ^^ the partition map will tell you its LBA
>>
> Thanks for the reply, .. however I would really prefer a way that could
> easily be scripted, something that will do a block copy of only the
> space in the partition table (which would be conriguous from 0 onwards;
> the main problem is I do NOT want to take the time to copy space not in a
> valid partition).


I don’t have any MBR disks at hand to check, but I believe `fdisk -l` and a little text parsing will provide everything you need to script the dd-block-count method for contiguous partitions.

	Zach
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2483 bytes
Desc: S/MIME digital signature
URL: <http://cialug.org/pipermail/cialug/attachments/20170728/635d5eb3/attachment.bin>


More information about the Cialug mailing list