Night Hawk

How to prepare a USB Flash Drive for Data Recovery

6 posts in this topic

With the latest general availability of usb flash or pen drives for fast transfers of data while on the go someone will always wonder about seeing Windows or another OS installed to removable devices when not having sufficient drive space to set up a working dual boot of any Linux distro with Windows.

The method outlined here however is not intended to be any dual boot setup running ubuntu on a usb device as your regular OS installation but for seeing a new form of data recovery tool available for those not familiar with the idea of using any Linux distro as a means of rescuing files from a Windows machine? eh? How is that possible?

Based on the idea first outlined in an old article titled "Computer First Aid Using Knoppix" another small live for cd type Linux distro seen at http://www.shockfamily.net/cedric/knoppix/ now seen in dvd form having grown considerably in size since the 2004 article was published a substitute distro smaller in size as well as still being able to access MS partition types was needed.

Fortunately another distribution with the Debian title known as ubuntu is quite a bit more familiar to many at this time being an easy to learn small distro booted from a live cd. Here we will take the "live" concept one step further and introduce the live flash drive method that can serve a dual purpose of more then simply trying out the latest Linux "flavor of the month" as often nick named but offer an alternate for rescuing personal data from any Windows even any Linux system suddenly found unavailble due to a problem like a bad partition table or OS not loadable situation.

First a few things will be needed in order to make this work. For those who often burn GParted or any distro onto a cd or dvd depending on size you are familiar with ISO type disk images and how to burn those to disk. We'll need to first download the latest 9.04 ubuntu release(64bit used here) and burn the live cd.

The second item to follow the blank cd just happens to be the usb flash you will be using. For the guide here a Kingston 16gb was chosen due to the larger capacity over many while larger 32gb and 64gb are available. The typical user walking into a retail outlet however usually will only see the 16gb above the smaller 2, 4, 8gb models for different brands like SanDisk, PNY, or another.

Due to the latest ubuntu 9.04 release also seeing one of the latest stable releases of the Gnome Partition Editor included the need for any separate GParted live cd or other drive partitioning tool would be one totally unnecessary step. In fact the first step shown in the first image here is how the 1)ubuntu root partition and 2)NTFS, Fat32, exFat32(NTFS 5.0 preferred!) are actually reversed to avoid problems when simply going to access the recovery partition while booted in Windows.

1gpartedpreparations.png

Share this post


Link to post
Share on other sites

Now why is the Linux partition so small compared to the NTFS volume as well as reversed and not the first partition as well as not seeing any swap partition present? is the first question many will start off. Once booted in Windows and clicking on the usb device's icon Windows XP, Vista. and now 7 will automatically prompt to format the first partition! Even with the first being the ntfs volume it may still need a second format to be usable in the version of Windows you happen to be in.

Upon even preformatting the ntfs partition with the Linux root/system partition being the first as well as labeling the volume to distinguish the two from each other Windows saw the label and applied that to the one already having ubuntu installed onto it and did not see the second MS volume! Instead the attempt to see Linux first failed when Windows reformatted ubuntu right off the usb drive in order to be able to mount and assign a logical drive letter. Which briings us to the second screen here where it all began when preparing the flash drive.

1partitioning.png

Now for the second question as why no swap partition was created and in fact not even required for this project is simple. With a small distro like ubuntu the virtual memory will be allocated to a swap file on the root or file system partition itself. Even with 4gb of memory installed on the system here there wasn't any need to see a second large swap file to accomidate that. Ubuntu loads right up off a cd with any swap partition seen there.

The larger server type distros are the ones that usually require a good 2-4gb size extended volume for the swap partition. So with keeping that in mind we move onto the installation having the partitioning task complete.

2installerlanguage.png

The next screen typically seen with the installation of any OS is things like location.

3locationst.png

The keyboard layout in order to be suited for your own personal use also plays a role to some degree there as well.

4keyboardlayout.png

Share this post


Link to post
Share on other sites

The next step is where we now have to pay a little bit more "close attention to detail" in order to end up seeing working results! As you can see from the next screen here the ubuntu installer is ready to go right after the hard drive and ignores the usb device automatically where the manual selection process for the step by step is required.

Once you reach the part for selecting the partition the ubuntu files will be installed to you also have to click on the edit button to select the partition type there as well as seeing that made the "/" mount point with that item seen at the top of the dropdown list. That works hand in hand with the next item to consider. The images here will show how to go about seeing that done.

5beditpartition.png

5ceditpartition.png

5deditpartitionsettingmointpoint.png

And finally you npw have the "/" mount point set which is one item required to see ubuntu start up.

5emountpointset.png

The screen there shows just where the Grub boot loader will be installed as well. The thing to keep in mind here is that we want this to be bootable on "any" desktop or laptop that supports booting from usb devices not just one machine alone as you would expect in a dual or multiple OS boot setup.

5advancedbootloaderoptions.png

The typical installation takes about 20 minutes when booting from the ubuntu cd whether selecting the installation option only or proceeding to the desktop where all this took place in order to have GParted and other tools available. That just happens to include the mounting of one of the internal hard drives once the screenshots seen in this guide where taken. From this point on there's no turning back once

6lastchance2bail.png

Edited by Night Hawk

Share this post


Link to post
Share on other sites

Once you have taken the large step the installation proceeds with the lengthy file copying process where everything is unpacked and configured on the Linux partition as you look on at the progress indicator. Once all files have been unpacked the next step concludes the live session you are in with the live cd and now need to restart the system in order to boot from the usb device as part of completing the installation there.

After watching and waiting as the files are being setup you finally reach the ubuntu 9.04 default desktop and are booted live from the usb device itself.

15hybme.png

If you already have an active internet connection available and are plugged in you receive another pleasant surprize as well. Updates are avialable for download and installation when the notification screen appears.

2q9wimx.png

If you click on the details item you watch as everything goes to work once downloaded.

2csbaj6.png

10details.png

With the online connection available you can check the mail or browse to see how things are going while still being booted live. You know that works well when first seeing the default ubuntu home page appear when first opening up the default browser FireFox 3.0.

11defaulthomepage.png

With all this complete you are now ready for? simply transferring a files to carry with you or actually recovering files from this machine at some time as a backup tool to have onhand or bring the usb flash drive to the desktop or laptop where the hard drive may need a reformat or seeing bad sectors needing replacement and no place for files to go! Now you see why you may not want the swap partition first noticed missing since you will then be needing all available drive space on the flash drive used for this.

Edited by Night Hawk

Share this post


Link to post
Share on other sites

PART #2 of DATA RECOVERY By Way of USB Flash Drive

In this second half of the guide long awaiting to see a finisk we will be looking at how to get things done once the usb flash drive has been prepared. Note the latest ubuntu 10.10 release will be seen in use on a different flash drive in the new screens to be added here.

Once the distro to be used whether ubuntu(much more familiar to many), Knoppix(much larger in size), Puppy(ideal for it's small size), or another possible Debian based selection like Mint has been successfully installed and loads runs normally booting from the second root partition.

Since this will not require any boot information on the main drive of a system you will still want to assign a drive letter for the flash drive itself rather then seeing it possibly being different each time the drive is plugged in case you have other flash drives in use or other usb external hard drives. The idea is having a data recovery stick that will be totally independent if you have to recover files from any other machine as well as possibly your main system.

The first place to go when having the drive plugged in and simply seen as usb flash drive where Windows already picked the first drive letter available would be the Disk Management tool where you scroll down to the removable section below the one or more hard drives installed.

8289a8532ac0bd15d2cf835eec9a010c.jpg

Note from the image there that the root will be found unavailable since the ext6 File Journaling system for Linux was used for the root or system partition the distro was installed to. The much larger data partition(NTFS or Fat 32 even exFat) will be the only one seen in Windows outside the Disk Management tool due to the non MS file system.

Even if the second was MS Windows can generally only see the first on a usb pen/flash/thumb drive as they called. The next screen is the simple process of choosing something other then E, F, G for example and going with an R for "Rescue" which sounds better! :)

b8ffcb72405e25174a7b4da60369fa14.jpg

That shows a totally different flash drive with the ext4 Linux partition for a direct install using the entire flash drive for the distro without a separate data partition to futher see how the drive is unavailable while booted in Windows just as the second root primary is in the first.

cb9365e373bc2cd9e4cce0564b3d38f8.jpg

The next screen here once a drive letter has been assigned however is for labeling the NTFS volume to distinguish the two apart as well as indicate in Windows Explorer for example where the data will go when simply copying and pasting files for a transfer when not in need of rescuing files.

20204ef7fdfe4c6cf5056e6c1307a3f4.jpg

Since you will likely want the drive for other things when not in need of a data rescue tool since Windows is running normally how about the typical data transfer between work/school and home? Once a drive letter is all set you can simply two explorer windows, one for the flash drive and the other for the folder where the files are located for the copy + paste to the flash drive.

4a76070dd67701fe339924947f946e87.jpg

Obviously the copy and paste there went fast simply being seen to while booted in Windows.

7fdefdbdcdedca42c4875338ade70f57.jpg

That was easy enough wasn't it? The screen there shows the contents of just one user folder being backed up or being copied for use on a second system. You might have an older laptop at work and want to keep things updated like your browser's favorites or bookmarks for example.

Now what will we find if the system is restarted and we attempt this while booted live from the flash drive we just turned into a data recovery stick? See for yourself!

a9b60fdde24d22d42855a53840cb6bc1.png

From that screen there something is a bit odd isn't it? Instead of simply copying files from one location on the main drive of the system that shows a copy and paste between two separate folders on the main drive but when booting a live Linux distro. Another screen could easily show files being copied onto the flash drive from the main drive of the system.

The point here however is to show that other things can also be seen to as well as since you are still working with a fully functional OS even when booting from the removable flash drive. Another advantage when booted live is being able to remove things like malwares or file found to be infected by a virus preventing Windows from starting where you need to see them removed manually until the system is cleaned.

Note when rescuing files or simply transferring them between two systems be aware that allowing the protections you have inplace to first scan all files recovered or being transferred is a wise move to prevent the spread of bugs!

9093ccaaf0731b39e73b772859661d45.jpg Digg

Share this post


Link to post
Share on other sites

Time to update this thread a bit with a few more options! First off several months after posting this guide a rather interesting article surfaced regarding just 10 Linux rescue tools for recovering Linux, Windows, or Mac machines pointing to the all time champ Knoppix 7.6.0 Live for DVD as the number one item on the list seen there for live recovery when your machine won't run.

Over the last 5-6yrs. some things have changed as far as which distros have grown in popularity as well as seeing a more recent distribution take the spot light away from the all too popular ubuntu for Linux Mint which just saw the 17.3 "Rosa" Mate edition released as well as the LMDE 2(Linux Mint Debian Edition 2nd edition) arrive lately as well. The 17.3 also offers the Cinnamon desktop with both coming in 32bit as well as 64bit flavors. Linux Mint Blog

Edited by Night Hawk

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now