Re: SOLVED? - Re: Command line for creating partitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 10, 2014, at 5:47 PM, Robert Moskowitz <rgm@xxxxxxxxxxxxxxx> wrote:
> 
> Thanks for all the help.  And I figured out another way when you want a real clean card for dd of an image then xz for a compressed form for distribution.  I did:
> 
> dd if=/dev/zero of=/dev/sdb bs=1M
> 
> and everything is gone.

Three critiques :-)
1. This doesn't remove the backup GPT, if present, which is at the end of the drive in the last ~34 sectors.
2. It's definitely not reversible, so if you make a mistake (which you shouldn't anyway of course), maybe one of your boots flips drive designations (which does happen and is expected), you've just obliterated the wrong drive.
3. It doesn't remove filesystem signatures beyond 1MB, so they could remotely be trouble down the road.

So I still like wipefs -a for each partition, then for the whole device, better.



>  Built the partition table, the partitions, laid down the files, booted up clean, then dd the image, xz compressed it and I now have a ice compressed image I can restore to start at a clean point and can distribute to others.

Oooooh. Well, you will have latent sectors that previously had data on them that will be vacuumed up with this dd image because it's a sector copy. So even unused sectors that have latent data will find their data in your dd image and xz will be thwarted making it as small (and private) as possible. Who knows what data is on those old latent sectors. So now you can ignore everything else I suggested prior to this.

If SD card reacts to TRIM, which many do, you can:
a.) mkfs.btrfs /dev/sdX
b.) wipefs -a /dev/sdX   

The default mkfs.btrfs behavior is a whole device TRIM, then it writes out a tiny amount of metadata, much less than other filesystems. Using wipefs removes that btrfs signature, and now you can build your media. On thing though is that SD card garbage collection might take a while and depends a lot on its firmware. So in the short term the dd read of the sdcard might still return latent data, until the firmware actually goes about erasing it.

Another option, is ATA security erase, but I don't know if SD cards support this. I know the above will work because I've been doing it the past few days for other testing.

Either way, the result is that there will be essentially no latent sector data, and your dd image will contain piles of zeros that xz will then compress away.

Chris Murphy
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux