Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
52
rated 0 times [  52] [ 0]  / answers: 1 / hits: 98171  / 2 Years ago, mon, april 11, 2022, 10:00:28

I'm currently running Ubuntu 12.04 and want to completely format my laptop so I can install Windows 7 (replace Ubuntu).



When I put in my bootable USB with the OS it just shows a black screen with a white blinking cursor on the top left corner. I wait for hours (to be specific 5 whole hours) waiting for something to happen but I get nothing, so I pull out the USB and my Ubuntu 12.04 loads up.



Repeated this several times with putting different boot priority options on top-est that relate to USB but the results are same. I go and visit some sites on the net like this http://www.techspot.com/community/topics/cant-replace-ubuntu-with-windows.175716/ that say I have to zero out my hard drive.



My question is how?



Note: Erasing out all my data is no problem cause I have nothing important to backup.



If I have to lose my primary OS (Ubuntu 12.04) in the process I am ready to as my aim is just to install Windows 7 successfully. Please don't answer that there is something wrong with my USB or my USB reader/port/hardware or the content inside the USB cause they all works fine on my brothers PC as it boots up flawlessly.


More From » 12.04

 Answers
0

Zero-out drive on Linux is done via:


dd if=/dev/zero of=/dev/sdX

where sdX is the device of the drive to delete.


If you're not aware on how to do this, press Ctrl+Alt+T from Ubuntu, and type following:


sudo dd if=/dev/zero of=/dev/sdb

In example above, sdb is the second connected drive.


NB! This will erase your drive completely. Use at your own risk.




EDIT 1:


Optionally, you might want to add status=progress to show progress status:


sudo dd if=/dev/zero of=/dev/sdb status=progress



EDIT 2:


As per comments below, setting the buffer size might significantly speed up the process:


sudo dd if=/dev/zero of=/dev/sdb bs=16M

Please note, however, with a buffer dd will not wait until operation is complete, so afterwards you might need to execute sync command, which synchronizes data on disk with memory.


sudo dd if=/dev/zero of=/dev/sdb bs=16M && sync

What's the purpose of sync? Simple: in case if your storage is slow and power off happens right after dd while disk data is not synchronized, some of the data might be lost. It might be not so relevant for this particular case about zeroing out the drive on PC, but for things like embedded systems with slow flash memories this needs to be considered.


[#38084] Wednesday, April 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
heathree

Total Points: 157
Total Questions: 132
Total Answers: 108

Location: Honduras
Member since Mon, Apr 5, 2021
3 Years ago
;