Ubuntu: It possible to reformat Ubuntu Hard drive without Live Disk?



Question:

My sister just wants to reformat her laptop with Ubuntu and throw it away/electronic recycling. I have no idea how ubuntu works and barely learned how to open the terminal. I tried reformatting in various ways but it keeps giving me the "/dev/sdal" is mounted error. And I know I cannot unmount it because that is where the operating system is being run. Is there a way to reformat the hard drive without the live disk? Any help would be appreciated. Step-by-step instructions preferred.


Solution:1

You can format any disk that is not mounted.

On an active system you can also use rm, dd, cp and cat. Examples (Yes, these will kill your system so you are warned (and yes I left the command needed in front of these out of them on purpose):

rm -rf /  dd if=/dev/urandom > /dev/sd{xy}  cat /dev/urandom > /dev/sd{xy}  cp /dev/urandom /dev/sd{xy}  

There are more methods, you can use the utility wipe, shred, the badblocks command, or scrub.

{xy} are the device letter and number (ie. sda1, sda2 etc).


/dev/urandom is a bottleneck. I found this on u&l from Gilles <3

openssl rand $(</proc/partitions awk '$4=="sda" {print $3*1024}') >/dev/sda  

is very quick (it messes up a complete disk).


Alternative: you can also format a partition from the grub rescue prompt with fdisk and parted (parted is the command line version of gparted).


If the intention is to throw away the disk: the only good method is to hammer a nail through the disk. Formatting can be made undone, a shredding tool should be used since those do more than 1 run over the whole disk writing digits at random making it impossible to restore.

And to add to this: SSD's have a high failure rate in deleting data from a disk. The best erasing method for SSD's is ATA secure erase but this is buggy (Paper related to this: 12 disks, 8 have ATA secure erase, 3 of those had a buggy implementation and 1 reported the disk was cleared but the data was still there).


Solution:2

You can't reformat the hard drive without booting to a different medium.

There are alternative methods including gui resolutions

For your information,while you might think it's hard, moving around the OS works much like Windows and the Mac, except I find it just a little easier. In fact the Mac is basically Linux (Unix) with a Mac picture over it. Microsoft Windows is growing more and more like Linux with every release. You could remove the files from Linux much like you would in Windows. Just click on the file explorer and systematically delete your sensitive stuff. Your personal stuff is stored by default in your user space. When you hit the File browser you'll be there. You can systematically remove all your stuff from there.

Unlike Windows and other OS' all your personal stuff will be in your home directory or a sub-folder off it. So removing your home directory will do it for all your personal information.

One easy way would be to create a new user. Log in as that user, then remove the home folder of your sister's userID.

If you can do it in any other OS, you'd have a great learning curb for doing it on Ubuntu. It's extremely intuitive.

Your object appears to want to remove the personal data from the computer. The steps I provided would do this. The description is to ease your mind of it being so much more different from what you are familiar with from the other environments.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »