2

I was intending to use dd to wipe my laptop's HD, but accidentally pressed enter with only

[dd if=/dev/zero/

without an of=... argument, then could not enter any further commands, so I cut the power.

Now, grub rescue comes up immediately after the BIOS, and when I ls, it doesn't show any partitions. I just want to finish wiping the drive, how do I get back to a command prompt?

Edit: Thanks so much for the comments, guys! The (admittedly crap) pic is what the machine boots into, with me trying to [ls] the partitions and finding none. I'm pretty new to all this, but this does not seem like it should happen unless the partitions have been wiped out, which does not seem possible, given how it came about.

Boots directly to grub rescue, cannot find partitions

A Green
  • 21
  • 2
  • Technically, `dd if=/dev/zero` should spit out a never-ending string of 0s to your terminal, so I doubt this is what created your boot issue. If `of=` is absent, then `dd` presumes `of=stdout` See the manpage for `dd` https://linux.die.net/man/1/dd – tudor -Reinstate Monica- Oct 13 '18 at 08:16
  • Welcome to Ask Ubuntu! Are you sure that’s the exact command that you issued? 1) On a sane system `dd if=/dev/zero/` should fail because `/dev/zero` is no directory but a special character device (thus the final `/` is wrong) and I get an appropriate error message when I try it. 2) Omitting the `of` flag causes `dd` to write to standard output instead; reading from `/dev/zero` to standard output may crash your terminal session due to the flood of characters written to it but it won’t affect your system configuration, i. e. it won’t affect the system after a reboot. – David Foerster Oct 13 '18 at 08:16
  • 1
    On the other hand the sudden power loss may have left the file system in an inconsistent state which caused Grub to break. Could you please [edit] your question to include the exact error message that Grub gives you before the rescue prompt? A photo is fine too. Thanks. – David Foerster Oct 13 '18 at 08:17
  • Using grub, can you try `insmod normal` and `insmod part_msdos` and `insmod_gpt` and `insmod ext2` then `ls` again? Currently it's showing only the disk which means either it needs the right module to read the partition table or you've done something terrible to the partition table. – tudor -Reinstate Monica- Oct 15 '18 at 03:02
  • Also, can you get a copy of the **alternate Ubuntu** ISO and install it onto a USB key or burn it to a CD and boot from that? From there you can do a recovery and/or run `testdisk` to recover partitions. – tudor -Reinstate Monica- Oct 15 '18 at 03:04

0 Answers0