1

I recently deleted the Windows 10 from my HP Pavilion Laptop and installed Ubuntu 16.04.1 LTS using a pen drive. In another pen drive, I stored all the important data of Windows 10. But after installing Ubuntu, when I connected the USB to the port on my Laptop. It wasn't showing anything but the following window popped up.

Complete image of "Sorry, This location could not be displayed".

When I connected that pen-drive in another Ubuntu Laptop, I observed that many folders were converted into the binary files. However, I wasn't able to cut and paste those folders from pen drive to my desktop but was successful in copying a few of the folders. What should I do to get back my important data from USB?

  • Did you verify the backup before deleting the data? Try in another Windows machine, but it seems that the USB drive is busted --- they fail quite often, unfortunately. – Rmano Dec 19 '16 at 08:53
  • @Rmano Sorry, but I don't understand what you mean by "verify the backup" here. – KhiladiBhaiyya Dec 19 '16 at 08:54
  • Yes --- after copying your data to the USB, before deleting it, have you re-plugged the USB and checked that all was ok? If the backup drive fails also on Windows, you should consider trying to recover it --- but given that it was made in Windows it would be better to try to recover it on the same operating system, to maximize chances. – Rmano Dec 19 '16 at 08:55
  • @Rmano, yes I verified the data and it was working fine on Windows. But there is no Windows OS in my locality and everyone has an Ubuntu desktop. Now, what should I do? – KhiladiBhaiyya Dec 19 '16 at 09:04
  • Depending on the importance of the data, I would probably reinstall (maybe in a virtual machine) a windows OS and recover it. It's the less risky path. I also would follow the advice in @sudodus' answer and clone the backup disk right now. – Rmano Dec 19 '16 at 09:07
  • Well I can't add much to what has been already said here. However, first try to check the USB using a windows machine because in your question you said you only tested it on another ubuntu. Sometimes by ubuntu fails to recognize USB sticks that are completely normal in windows or mac machines. I am also a newbie so I don't know why this happen so I just restart ubuntu with the USB plugged and most of the times it works fine after that! However, give it a try on windows and if it does not work then you should clone it and try to recover it. – Never.too.old.to.learn Dec 19 '16 at 10:02
  • Maybe it's an oversight of mine, but I can't find where you say what file system type is on the drive. Is it NTFS, FAT or exFAT? – Andrea Lazzarotto Dec 19 '16 at 14:37
  • @AndreaLazzarotto By using the mount command on Terminal, I found that it was written "type vfat" next to my USB location name. – KhiladiBhaiyya Dec 20 '16 at 09:17
  • Alright. Given that you can even at least mount it, the damage does not seem severe. After cloning it try to access the drive using TestDisk and report if it shows the contents. – Andrea Lazzarotto Dec 20 '16 at 12:27

1 Answers1

2

Overview

The data are important. This means that you should not mount this drive (only connect it). Then you should clone it to a drive of at least the same size, and do the recovery work on the cloned copy. This method will reduce the risk (that the recovery attempts will destroy data, than are possible to recover).

There are several helpful pages and several tools available via the internet. I wrote the following short page with tips and links to tools, that have worked for me.

Repair the partition table and file system of a pendrive

Details about cloning

Clone a drive to another drive of at least the same size. The drives are represented as block devices.

1. According to example 1 in 'info ddrescue'

Boot from a 'third' drive, for example the internal drive or another USB boot drive with linux.

Install ddrescue

sudo apt-get install gddrescue

It is a two-step procedure, where the second step is only necessary when there are 'difficult' or bad blocks on the source device (the USB drive)

sudo ddrescue -f -n source-device target-device log-file
sudo ddrescue -d -f -r3 source-device target-device log-file

for example

sudo ddrescue -f -n /dev/sdd /dev/sde log-file
sudo ddrescue -d -f -r3 /dev/sdd /dev/sde log-file

but check very carefully and modify the device letters to your particular case.

2. mkusb

If you find this too difficult or risky, we can hope that there are no bad blocks in the source device. Then it is possible to do this with mkusb. It will help you select the target device in order to avoid writing to the wrong one and overwrite valuable data.

Install mkusb:

If you run standard Ubuntu, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)

sudo add-apt-repository universe  # only for standard Ubuntu

sudo add-apt-repository ppa:mkusb/ppa  # and press Enter
sudo apt-get update
sudo apt-get install mkusb mkusb-nox usb-pack-efi

Run mkusb like this:

sudo -H mkusb source-device

To match the example above we assume

sudo -H mkusb /dev/sdd

and mkusb will display information about all devices and later the possible target devices to let you select it via a menu, where additional data is displayed.

01-clone-a-device-overview

mkusb will filter the devices, and only show what are suitable target devices with numbers to help you select the correct one, in this example a Sandisk Extreme pendrive at /dev/sde

02-select-target-device

03-final-checkpoint

04-progress.png

05-work-done

Check in the terminal window, that the whole device was read and all data written (cloned)!

...
99
100
1962864+0 records in
1962864+0 records out
8039890944 bytes (8,0 GB, 7,5 GiB) copied, 440,371 s, 18,3 MB/s
Done
do_n_show: Work done
---------------------------------------------------------------------------
Syncing the device ...
Done :-)
Cleanup after mkusb finished :-)
---------------------------------------------------------------------------
Total time used [by mkusb] = 886 s; 00:14:46

(In this case there was extra total time because I made screenshots.)

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • +1 for the suggestion of cloning the drive. Also look at http://askubuntu.com/questions/3883/how-to-recover-deleted-files and linked pages from there – Rmano Dec 19 '16 at 08:58
  • @sudodus, thanks for your suggestion. But since, I'm a newbie in Linux, I'm finding your method way too much difficult. Is there any other (easy) method, which can help me to fix my issue? – KhiladiBhaiyya Dec 19 '16 at 09:53
  • What is too difficult? To clone the drive - or the tools to repair the file system and recover your files? Please tell me, and I will try to explain. Is there someone nearby, who can help you 'hands on'? – sudodus Dec 19 '16 at 10:00
  • @DG4 if it is the cloning then you might want to consider Clonezilla, it is easy, well documented, and understandable: http://clonezilla.org/screenshots/?in_path=/00_Clonezilla – Never.too.old.to.learn Dec 19 '16 at 10:05
  • I am afraid, that Clonezilla is not the best tool, when the drive is corrupted, because it depends on the file system (at least in the standard mode). But there are ways to make the cloning easier than with ddrescue, at least when the drive is physically OK, that the memory cells and the internal programs of the pendrive work. It is possible to use mkusb in linux, and I think Win32 Disk Imager can do it in Windows. – sudodus Dec 19 '16 at 10:44
  • @sudodus actually I've tried few commands from the link which you referred to, but it didn't work for me. Actually, I am unable to understand how to use the tools for cloning? Is there any step-by-step procedure for doing it? – KhiladiBhaiyya Dec 19 '16 at 11:02
  • I will add it to my reply ... – sudodus Dec 19 '16 at 12:31
  • @sudodus, thanks for your help. I tried the first method of ddrescue according to your suggestion. But, I got this error - "ddrescue: Can't open input file: Permission denied". – KhiladiBhaiyya Dec 20 '16 at 09:27
  • @sudodus, Then, I tried the second method of mkusb, in which it was successfully installed but when I tried running it using the command : sudo -H mkusb /dev/sdd Again I got the error - "sudo: mkusb: command not found" What should I do now? – KhiladiBhaiyya Dec 20 '16 at 09:32
  • please post the output of the following command (without quotes) 'sudo parted -ls' as part of your question. Indent 4 spaces to make it display as 'code'. Try also the following command, 'which mkusb' – sudodus Dec 20 '16 at 09:32
  • I think I know the problem with ddrescue. I forget to put sudo in front of it. I will modify my answer. I'm sorry for that. – sudodus Dec 20 '16 at 09:38
  • @sudodus, I tried the ddrescue method again. The source device was my USB i.e. /dev/sdb and target device was the hard disk of the Laptop i.e. /dev/sda1. But this time, the Ubuntu got crashed in my laptop and I have to install it again. – KhiladiBhaiyya Dec 21 '16 at 11:54
  • I am very sorry, but it was not a good idea to write to /dev/sda1. It was problably your root partition with Ubuntu, and you destroyed it. The target drive should be another USB drive of at least the same size. Next time, please write the command line, that you intend to use, and wait until you get a confirmation, that it is a good one. Have you got a USB pendrive with Ubuntu, so that you can install it again? Finally - all experienced linux users have done something like you did now - if you dare not try, you will never learn, so cheer up :-) Keep asking and we will help! – sudodus Dec 21 '16 at 12:22