Unusual Question

Doug Hardie doug at mail.sermon-archive.info
Mon Jul 10 00:34:08 UTC 2017


> On 9 July 2017, at 17:18, Valeri Galtsev <galtsev at kicp.uchicago.edu> wrote:
> 
> 
> On Sun, July 9, 2017 4:57 am, Doug Hardie wrote:
>> I have a FreeBSD 9.3 remote server that needs to be purged.  I know that
>> rm -rf / will remove all the directory entries, but I need to write over
>> the drive.  I thought that dd if=/dev/zero of=/dev/ada0 might do the
>> trick,
> 
> If you were able to execute this, it still will not do the trick. What
> will happen is the following: the command at some point will descend into
> /dev and will delete block device / filesystem lives on, and after that
> point the command will just fail. I have vague recollection that that was
> one of the tricky questions on some sysadmin exam (Linux probably). I knew
> someone who actually did that on multi-user box he administered (space
> just snuck in after leading slash of absolute path). I happened to help
> him: we just mounted partitions on another machine and apart from /bin
> /boot and portion of /dev all still was there, so it was nothing like the
> disaster on can picture from nasty appearance of this command.
> 
> Someone at some point mentioned that rm command goes into directories and
> subdirectories NOR in alphabetical order, so I left that out, but in
> incident I mention nothing but what alphabetically is before the device /
> filesystem lives on (/dev/hda2 was our case I believe) was lost.
> 
> I hope, you had fun reading this ;-)
> 
> Valeri
> 
>> but it gives an not permitted error.  The whole thing can crash and
>> burn at the end.  This is an unmanned site so moving drives is not viable.
>> _______________________________________________

Thanks for the info.  I've never tried the rm approach, but the dd approach seems to work.  After a couple hours the machine became unresponsive and ssh sessions were terminated.  I think the drive is now empty.  I'd like to be able to get it back to verify, but that won't happen.  I still have 3 more systems to do this to.  The others will have to wait for awhile as I may still need them for a few more days.




More information about the freebsd-questions mailing list