Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 750  / 2 Years ago, tue, october 18, 2022, 4:50:52

I had Ubuntu 14.04 running sweetly however when installing an IMG to an SD card for a raspberry pi like so:



dd bs=4M if=2014-06-20-wheezy-raspbian.img of=/dev/mmcblk0


My beloved Ubuntu now boots like so:



BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs)


Have I just made a major mistake and dd over the filesystem on the HDD ? Is there a fix ?


More From » boot

 Answers
7

One of three things could be happening here (I'm not too familiar with Raspian):


The SD card is interfering with the boot sequence


It's possible that for some reason the boot process is picking up the partitions/files on the SD card and causing it to fail booting, try simply removing the SD card and reboot. I believe that should do the trick, if not you might have some trouble.


You fried your partition


If that command that you have above is the actual command you used, there shouldn't have been a problem. However, if you instead typed something along the lines of of=/dev/sdX# or of=/dev/sdX, then that would have friend the beginning of the partition number # or the beginning of the disk respectively.


If you did, in fact, somehow manage to fry your partition, then there's really not a lot you can do to recover the data aside from using a tool like testdisk (which may or may not work depending on whether all backup superblocks were wiped) or, worst case, scalpel to recover the files. Otherwise, simply reformat and try again.


dd can potentially be a very destructive program. It has no warnings that would tell you "Hey buddy, are you really sure you want to do this? It's probably a bad idea" -- it just goes. Therefore, you need to be sure that the command you type is the command you really want. For example, you might ensure that /dev/mmcblk is the correct device by first mounting the SD card (or a partition on it) and then finding the device listed in the mount command. However, from the command you typed it should have worked as expected...


There is an error in the boot sequence


I've seen this happen while creating custom ISOs and it tends to happen when the root filesystem can't be found (or it's corrupted). If you have a separate /home partition, then there still may be problem with with the root partition while your /home partition remained untouched.


As described here, remove the kernel options quiet and splash and append the kernel option debug while in GRUB (the bootloader). To do this, press E while you have a boot option selected. Once the line is edited, press Ctrl+X to boot.


This will write a /tmp/initramfs.debug file. After the system fails to boot, you can then use the httpd command to allow another computer to access the filesystem via a browser, or you can simply reboot with a LiveCD and examine the file. What you may be looking for is a line that says something similar to "Unable to find root partition."


It is also possible that the root filesystem is corrupt and needs to be fixed with a filesystem check. In order to do this, first boot from a LiveCD/USB.



  1. Open a console

  2. Find the partition in question using gparted-pkexec. If you suddenly have a big block of free space on your drive, it's very possible that the root partition got overwritten and may not be recoverable. If that's not the case, continue to step 3.

  3. e2fsck -p /dev/sdX# (where /dev/sdX# is the device and partition of your root filesystem (possibly /dev/sda4 or /dev/sda5, but you you'll want to verify that with gparted-pkexec from the LiveCD/USB)


[#23340] Wednesday, October 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gigglcept

Total Points: 113
Total Questions: 105
Total Answers: 125

Location: Christmas Island
Member since Wed, Jan 13, 2021
3 Years ago
gigglcept questions
Mon, Jul 5, 21, 19:38, 3 Years ago
Thu, May 27, 21, 13:35, 3 Years ago
Tue, Feb 8, 22, 09:59, 2 Years ago
Fri, Dec 16, 22, 12:32, 1 Year ago
;