How do I format a HDD prior to install?




  • Tom Miller

    I had to use: sudo dd if=/dev/zero of=/dev/sda

    This may take a while. After 15 minutes the command prompt had not come back. Now the screen has "garbled" and done 2 line feeds. Still no command prompt.

    Given all my previous Linux installs on this machine took roughly four times longer than on a non-SSD machine, I am going to give it an hour.

  • Forrest Smith


    The command is pretty slow because it writes bitwise.

    If you want to speed the process up, you can cancel out of it and then re-boot and use a slightly altered:

    sudo dd if=/dev/zero of=/dev/sda bs=4M

    This will just increase the block size and probably speed up the process.

    Good luck!

  • Forrest Smith

    Just a note:

    1) You can probably use bs=16M to speed things up

    2) You maybe only need to run this command for 30 seconds and then use ctrl+c to end it early - that wipes the disk's head where (what we think is) the relevant info is

  • Mucahit Senol

    If you see "Primary GPT Header is invalid" and "Secondary GPT Header is invalid" message during command line install, just terminate ctrl+c the installation do not wait for badblock check.

    Boot your computer with a Ubuntu usb disk and launch Gparted. Select your harddisk that you want to install ChromeOS. Create GPT Partition Table. After that it should be easy to install ChromeOS.

  • Brett Grosso

    So I'm trying this and it says
    dd: writing to '/dev/sda' : input/output error
    Anyone have any suggestions? I get essentially the same error when trying to install ChromeOS from the terminal. Ugh

  • Forrest Smith

    Brett -

    I/O errors usually mean the device has somehow come unplugged or is broken. Try physically re-seating it and then go again

  • Brett Grosso

    Thank you for the reply Forrest!! You mean the actual hard drive internally?

  • Forrest Smith

    yeah, assuming your computer is doing the normal thing and showing the internal HDD as /dev/sda .

    I don't have knowledge to tell you how, but you might also want to try live-booting some other linux distro/tool like gnuparted in order to try wiping the disk.

  • Brett Grosso

    Cool, I will give those things a try! Thank you!

  • Brett Grosso

    So I did try reseating the hard drive, didn't seem to help.. at this point I'm beginning to wonder if the hard drive is corrupt. The whole reason I'm doing this is because windows 10 wouldn't load suddenly. Just kept loading to a blank screen, mouse working and all. So I figured just turn it into a Chromebook, as this is my daughter's laptop. I'm kind of at a loss.. any further thoughts? thanks for all your support btw..

  • Forrest Smith

    If Windows breaking was the first thing to happen, and reseating it didn't work, then I think your hdd is toast. They're cheap to replace via amazon if you think the computer is still in good shape otherwise.

  • Anthony Emma

    Hey folks,

    Forrest, I'm running sudo dd if=/dev/zero of=/dev/sda bs=16M and I just have what appears to be a frozen screen. I saw

    "You maybe only need to run this command for 30 seconds and then use ctrl+c to end it early - that wipes the disk's head where (what we think is) the relevant info is"

    Has that worked for anyone?

  • Forrest Smith

    Anthony -

    Safest thing is to let it run - it looks frozen, but really it just take ~30 minutes.

    Once the cmd line returns to a normal prompt it should be fully wiped

  • Anthony Emma


    I have a stack of old WinXP Compaq 610 Notebooks. The machine isn't listed on the compatibility list, so I had slim hopes.

    The GUI Installer didn't ever work after leaving it overnight, so I tried the command line install ( and it worked w/o a hitch.

    I moved to the second notebook and just kept getting the "Primary GPT Header is invalid" and "Secondary GPT Header is invalid" errors.

    I left it on my desk overnight. It was done in the AM and now the command line install is working perfectly.

    Thanks all.

  • Forrest Smith

    Glad to hear it! Hope your installations continue well.

  • Greg Robinson

    Sorry for the rookie question here, but can someone provide the step-by-step instructions for doing this HDD format? I've tried 3 times using the Install CloudReady function on my old HP laptop (previously running Win7) and it keeps never finishing. I've let it run as much as 90 mins to no avail. It's a 320GB HDD. Should I wait longer?

    Assuming my issue is something on the HDD, I'd like to try this format as step 1. But I'm a total linux rookie. Can I get the steps written out? Sorry if they're already posted somewhere and I missed them. Feel free to point me to another URL if easier.

    Thanks in advance! Really want to give CloudReady a shot but I'm not keen on running off the USB forever. :)

  • Forrest Smith

    Hi Greg -

    1) Log in
    2) press "ctl+alt+t"
    3) type "shell" and then "enter"
    4) Do the steps above, replacing "sdX" with your HDD's name. It is probably "sda", but make sure that NOTHING of importance is left on your computer, since all of it will be nuked, and that the ONLY storage devices attached to the computer are the USB installer and the single internal HDD you want to erase.
    ----you'll be prompted for a password, which is "chrome"
    5) When all that is done, reboot into your USB installer once more, and try the GUI-install wizard again.

  • Greg Robinson

    Thanks, Forrest!

  • Peter Smulders

    The following is not for the faint of heart and you should avoid it if you are unsure what you are doing.

    I am doing command line installs on a stack of old laptops and the command line install consistently fails with the 'GPT invalid something something' error. On a hunch, I decided to manually rewrite the partition table. If you want to do that and/or need to find out how to tweak this solution for yourself:

    $ sudo /sbin/fdisk -l

    This will show you (in a verbose way) which disks you have and what they are called. NB: if you boot from different media and/or the harddrive itself, the names change! Always make sure that the disk you expect has the name you expect. Let's say /dev/sda is the disk we want to install onto.

    $ sudo /sbin/fdisk /dev/sda

    then (in fdisk), type 'p' to print the current partition table. This is most likely showing you 1 to 4 or 5 partitions (typical OEM Windows). In any case, you want to delete what is there and replace it with a new partition table. To do that, type 'g' (fdisk is not very verbose nor subtle...)

    Type 'p' again to see what the effect would be. If happy, type 'w' to actually write the new table to disk.

    NB: this will not exactly destroy what is on the disk, but it will make it essentially inaccessible to all but some rather specialised software. The partition table is the top-level table of contents of what goes where on the platters of a disk. If you replace that, new stuff will just get written over whatever was there before; you will NOT even see your data again. You have been warned.

    Now, I found it more than tedious to so this over and over again, so I worked out how to type it once and wait (allowing me to move on to the next machine in line):

    $ (echo g; echo w) | sudo /sbin/fdisk /dev/sda

    Depending on when last you used sudo (there is a timeout involved) you may be asked for your password. It will take about ten seconds and will be done.

    I found this step to be sufficient to have the command line installer bitch and moan all the way through about invalid GPT headers, but it will actually just do what it needs to and succesfully complete its job.

  • dragon788

    As a quick check and fix before you perform a CloudReady install you should enter Guest Mode, open a shell with Ctrl+Alt+T and then run `sudo /usr/sbin/cgpt show /dev/sda`. If it reports Invalid GPT headers you can run `sudo /usr/sbin/cgpt repair /dev/sda` and then try show again. If it still doesn't work you can try `sudo /usr/sbin/cgpt create /dev/sda` and then try show again. After this I was able to install on a drive that failed when I first attempted a manual install.

    The drive I was using was an NVMe, so my device name was actually /dev/nvme0n1 but after doing the above I was able to install by specifying that explicitly as the --dst argument.

  • codechippy

    Hi Forest

    One of the problems with "dd" traditionally is that it has not been verbose, so your dd command would go silent and you had no clue how far it had progressed, which for a 500GB drive could be hours.

    looks like the version you guys bundle has the new verbose option so you should add the "status =progress"

    sudo dd if=/dev/zero of=/dev/sdX bs=4M statu=progress


  • John Seers


    sudo /usr/sbin/cgpt show /dev/sda`

    I tried this but just got command not found. 

Please sign in to leave a comment.