0

I have a Dell Inspiron 5521 laptop running Ubuntu 15.10 and Windows 8.1 on dual boot. I was moving some files in the terminal when i did sudo mv /* to an external SD card. I immediately realized that I made a mistake and cancelled the operation and in panic, I powered my system off. Now the system will not boot, it shows a Checking Media [Fail] messages. I checked the BIOS settings and te boot options are empty.

I then loaded the boot-repair disk and it showed everything as normal but gave the following message when I used the "Fix common issues" option.

GPT detected. Please create a BIOS-boot partition (>1MB, unformatted filesystem, bios_grub flag) This can be performed using tools such as Gparted. Then try again.

The output of ls -lah on the SD card is: output of ls -lah on SD card:

ubuntu@ubuntu:/media/ubuntu/SETTINGS$ ls -lah
total 16K
drwxr-xr-x  4 root root 1.0K Jan  1  1970 .
drwxr-x---+ 5 root root  100 Jan  7 05:03 ..
drwxr-xr-x  4 root root 1.0K Jan  1  1970 cache
drwx------  2 root root  12K Jan  1  1970 lost+found
-rw-r--r--  1 root root   56 Jan  1  1970 noobs.conf
-rw-r--r--  1 root root   78 Jan  1  1970 wpa_supplicant.conf

The output of ls- lah on the hard disk is:

ubuntu@ubuntu:/$ ls -lah
total 2.0K
drwxr-xr-x   1 root root  240 Jan  7 04:57 .
drwxr-xr-x   1 root root  240 Jan  7 04:57 ..
drwxr-xr-x   2 root root 3.4K Oct 21 16:07 bin
drwxr-xr-x   1 root root   60 Oct 21 16:07 boot
drwxr-xr-x  13 root root 2.0K Jan  1  1970 cdrom
drwxr-xr-x  20 root root 4.9K Jan  7 05:03 dev
drwxr-xr-x   1 root root  640 Jan  7 04:57 etc
drwxr-xr-x   1 root root   60 Jan  7 04:57 home
lrwxrwxrwx   1 root root   32 Oct 21 15:59 initrd.img -> boot/initrd.img-4.2.0-16-generic
drwxr-xr-x   1 root root   60 Oct 21 16:04 lib
drwxr-xr-x   2 root root   43 Oct 21 15:49 lib64
drwxr-xr-x   1 root root   80 Jan  7 05:00 media
drwxr-xr-x   2 root root    3 Oct 19 09:14 mnt
drwxr-xr-x   2 root root    3 Oct 21 15:49 opt
dr-xr-xr-x 229 root root    0 Jan  7 04:56 proc
drwxr-xr-x  21 root root  338 Oct 21 16:07 rofs
drwx------   2 root root   46 Oct 21 16:06 root
drwxr-xr-x  28 root root  860 Jan  7 04:59 run
drwxr-xr-x   2 root root 4.7K Oct 21 16:08 sbin
drwxr-xr-x   2 root root    3 Oct 21 15:49 srv
dr-xr-xr-x  13 root root    0 Jan  7 04:57 sys
drwxrwxrwt  10 root root  260 Jan  7 05:05 tmp
drwxr-xr-x   1 root root  100 Oct 21 15:58 usr
drwxr-xr-x   1 root root  160 Oct 21 16:07 var
lrwxrwxrwx   1 root root   29 Oct 21 15:59 vmlinuz -> boot/vmlinuz-4.2.0-16-generic

Please help. This has been driving me crazy.

Edit: I tried Reinstalling Ubuntu from the live disk, it was going ok unity I encountered the error: The 'grub-efi-amd64-signed' package failed to install into /target/. Without the GRUB boot loader, the installed system will not boot. I am not sure why this error would occur.

  • So what you're saying is you did mv /* /media/username/sdcard , something like that,right ? I'd say reinstall, overwrite your Ubuntu partition with new Ubuntu partition. It's going to be the easiest solution to repair the system. If mv didn't get as far as your home directory, you could still recover those files with a bootable USB drive and USB disk to save files there. But simplest , less painful solution - erase the old stuff with new stuff. – Sergiy Kolodyazhnyy Jan 07 '16 at 04:27
  • The home directory with all my files seem intact but I am unable to recover those as I cannot move the files to another storage device because I keep getting a "Permission Denied" when I try to move files. – Nitin Kashyap Jan 07 '16 at 05:18
  • what command did you type prior to "Permission Denied" ? – 16b7195abb140a3929bbc322d1c6f1 Jan 07 '16 at 05:20
  • For example if I try to move a file named 2_node_addition.png using this: ubuntu@ubuntu:/media/ubuntu/a7089b2c-2748-4b9d-8f17-02169bb0402a/nitin$ cp 2_node_addition.png /media/ubuntu/SETTINGS cp: cannot create regular file ‘/media/ubuntu/SETTINGS/2_node_addition.png’: Permission denied – Nitin Kashyap Jan 07 '16 at 05:22
  • try using sudo to backup the home folder from your hard disk, then try following this - https://askubuntu.com/questions/362689/gpt-detected-please-create-a-bios-boot-partition-while-using-boot-repair – 16b7195abb140a3929bbc322d1c6f1 Jan 07 '16 at 05:24
  • if that fails, you can do as @Serg suggested and reinstall ubuntu then copy your home files back to your hard disk. sounds like the easiest way to go. – 16b7195abb140a3929bbc322d1c6f1 Jan 07 '16 at 05:24
  • Well, you're booting from live USB , right ? The user there is ubuntu and your files are owned by your original username. What you need to do is use chroot which basically is using system on hard-drive through live usb, sort of connecting to it. Follow the chroot instructions , then connect another usb disk, mount it (easiest with udisksctl mount -b /dev/sdX, find out X number with lsblk ), and then copy your files from home to usb. After all done, wipe that partition and install new ubuntu partition – Sergiy Kolodyazhnyy Jan 07 '16 at 05:35
  • I could post a more detailed procedure in the answers section, but the main idea is in the comment i posted just now. Let me know – Sergiy Kolodyazhnyy Jan 07 '16 at 05:37
  • Ok this seems to work now. I'm backing up just the deja-dup files so that I can restore all my files from that. – Nitin Kashyap Jan 07 '16 at 05:38
  • But just curious, does the absence of any boot options in the BIOS not indicate a more serious problem? – Nitin Kashyap Jan 07 '16 at 05:43
  • Don't worry about the BIOS. Your HDD is booting fine and there has been no indication that your HDD is not booting. – 16b7195abb140a3929bbc322d1c6f1 Jan 07 '16 at 08:59

1 Answers1

0

Try this:

  • Boot from an Ubuntu Live CD
  • Move all of the files from the SD card back to your hard disk
  • Reboot

Your next issue is probably going to be permissions but we can work that out after the files are back on your hdd