PDA

View Full Version : How To Make A Persistent Usb Flashdrive When Only Windows Is Available(Windows Only)



mmusket33
2015-08-21, 06:28
The following method allows a Windows only user with no Linux operating system available to make a Persistent USB install of Kali Linux. We have seen comments in these forums that this cannot work. This method outlined has been tested in Musket Team labs and works just fine.

Overview:

Windows can make a live install of Kali-Linux on a usb FD however it requires a Linux operating system to install the persistence. For Windows only users looking for persistence, this is like making a chicken before the egg. To solve this problem MTeams uses two(2) live USB FD easily made thru Windows and then employs one(1) FD to act as an operating system and install the persistence on the second FD.

Equipment Required

1. kali-linux 1.10a or 2.0 iso file

2. Win32Diskimager

3. Two(2) USB Flash Drives(FD) at least 8 gig in size. It might be easier if you have two(2) FD of different sizes but it is not necessary.

Make two(2) live kali linux FD. Use Kali 1.10a or kali2.0 as gparted is already included with the install.


Install Kali-Linux onto the usb flash drive using Window and Win32DiskImager.exe(Win32). Download the latest Win32 if you wish, however older versions might work.Make sure Win32DiskImager is pointed at your usb flash drive. When you browse to the location of your Kali-linux 2.0.iso, change the "Files of Type" from "img" to *.* - select the down arrow across from "Files of Type" and you will get this selection in a drop-down menu. Once selected the Kali-Linux.iso file will appear. Select it and select "write" then sit back and wait while the diskimager does it's work.

Test both FD

1. Boot them up

2. Select Live (686-pae) with your up and down arrows and test to see that the Operating systems(OS) have basic functionality.


Installing Persistence

Boot the computer with one(1) FD which will act as the OS

Open a terminal window and type

gparted

In the upper right-hand corner of the gparted window you will see a small greyish rectangular block with the word /dev/??? then a size in GiB and two(2) up-down arrows. Click on these arrows until you see the usb FD.

You should see two(2) long rectangular blocks.

In this example we see:

/dev/sdb1 unallocated
3.09 GiB 4.28 GiB

You now know the designation of the usb FD acting as the operating system.


With one(1) FD as the OS plug in the second usb FD, use the same small rectangular window and select the up and down arrows till you see the second usb FD. If no second usb FD is seen restart gparted and try again

Here we see:

/dev/sdc1 unallocated
3.09 11.74GiB


In this example we used two(2) usb FD as follows:One(1) FD was an 8 gig and the second was a 16 gig. Having different sized FD will make the process easier as you can easily determine which FD is the operating system. In our example here the 8 gigabyte FD is providing the OS therefore we will enable persistence on the second 16 gig FD

To enable persistence we need to format the 11.74 unallocated space.

With the second FD in the gparted window right-click within the right-hand large unallocated rectangular block. You need to format and label this block.

When you right click within the block a menu will appear.

Select New

In the "Create new Partition" drop down menu

Select

Create as: Primary Partition
File system: ext4
Label: persistence

Enter the word persistence carefully. Do not misspell or alter caps or the persistence feature may not work.

When completed select:

Add

Go to upper left-hand corner of the main gparted menu

Click Edit
Select Apply All Operations
Select Apply

Sit back and wait till the operations are all completed. Gparted will format the disk and when all operations successfully completed enter close

The 16 gig flash drive now shows

/dev/sdc1 /dev/sdc3
3.09 11.74

Notice the sdc3 designation. You will use that in your commands below


Open a terminal window

Enter the following:

mkdir -p /mnt/usb
mount /dev/sdc3 /mnt/usb
echo "/ union" > /mnt/usb/persistence.conf
umount /mnt/usb

Now test the persistence feature

Shut down the computer
Remove the FD that was providing the OS
Reboot the computer from the usb you just enabled persistence on.

When the menu appears

!!!Select Live USB Persistence ONLY ( with up down arrows)!!!

Warning if you select Live (686-pae) you will not load any persistent data and the test for persistence will fail.

Open leafpad i.e. Applications leafpad or open a terminal window and type leafpad.

Save a text file to root.

Type ls in a terminal window and check to see that the file is saved.

Reboot the computer(type reboot in the terminal window)

When the menu appears

!!!Select Live USB Persistence ONLY ( with up down arrows)!!!

Warning if you select Live (686-pae) you will not load any persistent data and the test for persistence will fail.

If the text file is still there then the persistent feature is functioning. Do not try and upgrade your persistent usb but you can update the existing files. If the persistence is missing, you did not select Live USB persistence or you misspelled the word "persistence" or you used the wrong ??sda/sdb/sdc?? entries in the terminal window commands given above.

You can now repeat the same steps on the other flash drive if you wish.

If you are new to linux take your time and work thru the commands slowly. If you make a mistake try again.

Musket Teams