Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by Matir
FYI, binary one is 0x01, unless you mean every bit binary one, which would be 0xFF/binary 11111111/decimal 255/octal 377.
Yes, that's what I meant and why I wrote "0xFF".
Quote:
Originally Posted by Matir
And no, no such virtual device exists.
A pity. So what do those programs do which flip bits on your hard disk several times to get their "0xFF" (e.g. for secure erasure)?
Quote:
Originally Posted by Matir
You could do something like:
Code:
tr '\000' '\377' < /dev/zero
Is this the best (no criticism intended)? It looks a little heavy on the CPU side, so to say...
@ pixellany
Quote:
Originally Posted by pixellany
...I don't think so.....If the keepers of the tablets provided this, then people would ask for /dev/two, and /dev/three.....There would be no end...
Not really. All zeros or all ones are end members the others just patterns in between. You need the end members e.g. for secure erasure of disks. Of course there are workarounds but /dev/one would be a clean solution .
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Well, I was thinking along the lines of secure erasure of hard disks. I read that one had to change the values of the bits five to seven times to make it forensically impossible to reconstruct the contents of the disk.
To make sure that every bit on a hd is flipped, it is not enough to use /dev/urandom which might or might not flip a particular bit, being random as it is . You can insure that only by a "hard wired" flipping of all bits to 1-0-1-0-1-0...
Since there is /dev/zero I was interested whether there is a comparable handy tool like a /dev/one, but alas ... .
There's a program called "wipe" designed to do just that. Or you can use a bootable disk like "Dan's Boot and Nuke", designed explicitly for wiping data.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Thanks for "wipe", dban I knew. I guess I'll have to read their readmes, perhaps they describe their technique(s) and how they get their 0xFFs. Anyhow, it was worth a question to LQ, thanks for your sustained input and help.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by JZL240I-U
...read their readmes...
Done.
Anybody reading this thread please go to sourceforge and read the documentation for dban and wipe (and links therein! Or dig for literature by P. Gutmann). Zeros and ones are not a good idea at all for "cleaning" hard disks...
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Now this is interesting, thanks a load FreeBSoD. I didn't do a kernel compile yet (I have only a 56k modem access to the net), but I will bookmark this and when I am big or rather my modem grows to reasonable speeds I'll come back here and try it.
Why not wipe the drive with the urandom device a few times and then zero's. Actually, if you are going encrypt your partitions, you want to start with the partition filled with psuedo-random junk, rather than all zero's or all ones. If on the other hand you are going to reuse the drive for a fresh install and want to create an image backup, having zeroed out free space will allow the image to compress nicely.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.