I know there are already some answers targeting both the problem with the initramfs prompt, and the problem about accidentally using dd and writing sda, however, I found no help with those questions, and I thought that mentioning my specific problem can make more sense to someone experimented with this (and can be a life saver for someone who runs into the same problems in the future).
First, I was having a problem with my Ubuntu, I could see no icons, and more than that, some UI things were not working well (which made it hard to use), I was using GNOME Flashback, and well, I eventually got tired of the problem, and decided to reinstall Ubuntu (the idea was to not lose any of the data in /home, I've got the idea from this question). I thought that this solution would restore the system settings, so that I could see the icons, and that I would lose no data at all.
Then, to create the bootable USB, I plugged it in, and ran: dd if=/path/to/iso of=/dev/sda
, I realized that I meant /dev/sdb, and then stopped the command fairly quick with CTRL+C. However, the damage was done. The computer did not shut down there, and silly of me, I thought that trying to reinstall Ubuntu would fix that problem too, so I restarted the computer (big mistake, as of this question) after having succesfully created the bootable USB.
Then I got to the state I'm now, I can't boot to my Ubuntu normally, and what is even more worrying, is that I can't even start a live session from the USB. I used this same USB in the past, with this same machine, and all worked fine, and just to be sure, I even went to another computer, and burned the Ubuntu .iso again there, but no luck.
When trying to boot from the live USB (both times), everything goes well until I select 'try Ubuntu without installing' or 'install Ubuntu', none of them works, and leaves me with a console-like view, with a prompt that says: (initramfs)
(sometimes with an error that says: "Unable to find a medium containing a live file system). None of the answers given here worked for me, since I can't run most programs from this prompt, I can't run fdisk, nor fsck (I wonder why, does this has anything to do with having used dd to write sda?), so it's a rather useless prompt.
The Ubuntu I was running, and the one I was trying to reinstall is Ubuntu 16.04LTS, and it's a laptop, so I can't take out the hard drive.
I've been hours researching, but I'm not finding anything useful for my specific case. What I would like to do is to:
- Boot from the live USB, so that I can save important data. I know most of the data is there even after the
dd
, since I was able to view most of it after having run that command. - Reinstall Ubuntu, if I can make the previous step, it's not so important if I reinstall it, or if I install it from zero again, since my data would be backed up. The thing is that I want to have a usable machine.
Why is this question different to other similar questions?:
- Can't install/try Ubuntu after dd sda hard drive: Here OP doesn't mind losing everything, and what's even more important, he seems to be able to run Ubuntu from live USB, or at least that's what the answers propose.
- Ubuntu 12.04 LTS Unable to boot - No Bootable device: Completely different error message.
I'm willing to read any material you can provide to understand more of what's going on, and I'm willing to provide more information if you request.
Sorry if I forgot important details, please specify them in the comments section and I'll try to show those details.
And finally, thank you a lot for your help.
testdisk
program to try to repair/dev/sda
before any thing else. – WinEunuuchs2Unix Jan 16 '18 at 18:16testdisk
when I'm not able to even boot from live USB? I'm just face with theinitramfs
prompt, and I can't run a program like that. – Maximiliano Redigonda Jan 16 '18 at 18:19/dev/sda
happen to refer to the USB drive with the Ubuntu Live system when you randd
on it? Does the drive boot on other systems? You should probably recreate the bootable drive from scratch. – David Foerster Jan 16 '18 at 19:03/dev/sda
was my hard drive. I'm trying to use testdisk from a GParted live session and following this guide to fix this problem. – Maximiliano Redigonda Jan 16 '18 at 19:37fdisk l
from the live session of GParted doesn't give me errors, but I'm not able to boot normally, a blinking underscore appears. As other people said, thedd
command might have deleted the/boot/
folder, maybe deleting the grub. I don't know much of this, should I try to install grub from the live session or something like that? – Maximiliano Redigonda Jan 16 '18 at 20:56testdisk
on a boot USB! Saved me some after-work home-work. – WinEunuuchs2Unix Jan 17 '18 at 00:58testdisk
on the drive as the first repair attempt? – WinEunuuchs2Unix Jan 17 '18 at 01:05testdisk
for something like 24 hours over two days using various techniques it offers and multiple passes to get everything back except a few Megabytes of the disk and then rebuild the MBR. Luckily the beginning of the disk was all programs that couldn't be recovered so no great loss. – WinEunuuchs2Unix Jan 17 '18 at 01:30dd
, when you want to create your USB boot drive. The tool should help you identify the drives and there should be a final checkpoint, where you can double-check that everything is correct. The script by @WinEunuuchs2Unix is such a tool. There are also other tools with similar properties and more or less 'bells and whistles', whiledd
is very basic and does what you tell it to do without any questions. – sudodus Jan 17 '18 at 06:42