From charlesreid1

No edit summary
Line 12: Line 12:


Look for the USB drive. Should be at <code>/dev/sdb</code>.
Look for the USB drive. Should be at <code>/dev/sdb</code>.
==Create Persistent Partition==


Now we will create a partition on the USB drive, which will store persistent data.
Now we will create a partition on the USB drive, which will store persistent data.
===Before===
Here is what the disks look like before:
<pre>
root@kali:~# fdisk -l
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 14F3CA11-2903-4ABB-B891-5C4584781D0D
Device        Start      End  Sectors  Size Type
/dev/sda1        40    409639    409600  200M EFI System
/dev/sda2    409640 194715871 194306232  92.7G Apple HFS/HFS+
/dev/sda3  194715872 195985407  1269536 619.9M Apple HFS/HFS+
/dev/sda4  195985408 488134983 292149576 139.3G Apple HFS/HFS+
Disk /dev/sdb: 14.5 GiB, 15512174592 bytes, 30297216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0a9a1b1a
Device    Boot  Start    End Sectors  Size Id Type
/dev/sdb1  *        64 6324223 6324160    3G 17 Hidden HPFS/NTFS
/dev/sdb2      6324224 6485375  161152 78.7M  1 FAT12
Disk /dev/loop0: 2.8 GiB, 2969686016 bytes, 5800168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
</pre>
===Create Partition===
Now we create the partition:


<pre>
<pre>
root@kali:~# end=7gb
root@kali:~# end=7gb
root@kali:~# read start _ < <(du -bcm /root/mac/Users/charles/Downloads/kali-
kali-2.0.1-rpi.img
kali-2.0.1-rpi.img.xz
kali-2.0.1-rpitft.img.xz
kali-linux-2.0-amd64.torrent
kali-linux-light-2.0-armhf.torrent
root@kali:~# read start _ < <(du -bcm /root/mac/Users/charles/Downloads/torrent/
2015 - Seveneves.m4b
.DS_Store
kali-linux-2.0-amd64/
kali-linux-light-2.0-armhf/
LibreOffice_5.0.3_MacOS_x86-64.dmg
mactex-20150613.pkg
New Watergate/
Nixon.1995.DVDRip.XviD.AR/
The Haldeman Diaries - Inside the Nixon White House/
The Nixon Defense - John W. Dean/
root@kali:~# read start _ < <(du -bcm /root/mac/Users/charles/Downloads/torrent/kali-linux-2.0-amd64/kali-linux-2.0-amd64.
kali-linux-2.0-amd64.iso          kali-linux-2.0-amd64.txt.sha1sum
root@kali:~# read start _ < <(du -bcm /root/mac/Users/charles/Downloads/torrent/kali-linux-2.0-amd64/kali-linux-2.0-amd64.iso | tail -1); echo $start; parted /dev/sdb mkpart primary $start $end
root@kali:~# read start _ < <(du -bcm /root/mac/Users/charles/Downloads/torrent/kali-linux-2.0-amd64/kali-linux-2.0-amd64.iso | tail -1); echo $start; parted /dev/sdb mkpart primary $start $end
3167
3167
Line 43: Line 67:
6485376..13671875).
6485376..13671875).
Is this still acceptable to you?
Is this still acceptable to you?
                                                                                                                                          Yes/No? y
Yes/No? y
 
Warning: The resulting partition is not properly aligned for best
Warning: The resulting partition is not properly aligned for best
performance.
performance.
Ignore/Cancel? Ignore
                                                                    Ignore/Cancel? Ignore
 
Information: You may need to update /etc/fstab.
Information: You may need to update /etc/fstab.
</pre>
===After===
Here is what the disks look like after. There is a new <code>/dev/sdb3</code> partition:


                                                                    root@kali:~# fdisk -l
<pre>
root@kali:~# fdisk -l


Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors

Revision as of 17:03, 20 January 2016

Start with your Kali USB drive. See Kali/Installing for details.

Instructions

Following the instructions here: http://docs.kali.org/downloading/kali-linux-live-usb-persistence

In this example, we’ll create a new partition to store our persistent data into, starting right above the second Kali Live partition and ending at 7GB, put an ext3 file system onto it, and create a persistence.conf file on the new partition.

fdisk -l

Look for the USB drive. Should be at /dev/sdb.

Create Persistent Partition

Now we will create a partition on the USB drive, which will store persistent data.

Before

Here is what the disks look like before:

root@kali:~# fdisk -l

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 14F3CA11-2903-4ABB-B891-5C4584781D0D

Device         Start       End   Sectors   Size Type
/dev/sda1         40    409639    409600   200M EFI System
/dev/sda2     409640 194715871 194306232  92.7G Apple HFS/HFS+
/dev/sda3  194715872 195985407   1269536 619.9M Apple HFS/HFS+
/dev/sda4  195985408 488134983 292149576 139.3G Apple HFS/HFS+

Disk /dev/sdb: 14.5 GiB, 15512174592 bytes, 30297216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0a9a1b1a

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdb1  *         64 6324223 6324160    3G 17 Hidden HPFS/NTFS
/dev/sdb2       6324224 6485375  161152 78.7M  1 FAT12

Disk /dev/loop0: 2.8 GiB, 2969686016 bytes, 5800168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Create Partition

Now we create the partition:

root@kali:~# end=7gb
root@kali:~# read start _ < <(du -bcm /root/mac/Users/charles/Downloads/torrent/kali-linux-2.0-amd64/kali-linux-2.0-amd64.iso | tail -1); echo $start; parted /dev/sdb mkpart primary $start $end
3167
Warning: You requested a partition from 3167MB to 7000MB (sectors
6185546..13671875).
The closest location we can manage is 3321MB to 7000MB (sectors
6485376..13671875).
Is this still acceptable to you?
Yes/No? y

Warning: The resulting partition is not properly aligned for best
performance.
Ignore/Cancel? Ignore

Information: You may need to update /etc/fstab.

After

Here is what the disks look like after. There is a new /dev/sdb3 partition:

root@kali:~# fdisk -l

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 14F3CA11-2903-4ABB-B891-5C4584781D0D

Device         Start       End   Sectors   Size Type
/dev/sda1         40    409639    409600   200M EFI System
/dev/sda2     409640 194715871 194306232  92.7G Apple HFS/HFS+
/dev/sda3  194715872 195985407   1269536 619.9M Apple HFS/HFS+
/dev/sda4  195985408 488134983 292149576 139.3G Apple HFS/HFS+

Disk /dev/sdb: 14.5 GiB, 15512174592 bytes, 30297216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0a9a1b1a

Device     Boot   Start      End Sectors  Size Id Type
/dev/sdb1  *         64  6324223 6324160    3G 17 Hidden HPFS/NTFS
/dev/sdb2       6324224  6485375  161152 78.7M  1 FAT12
/dev/sdb3       6485376 13671875 7186500  3.4G 83 Linux

Disk /dev/loop0: 2.8 GiB, 2969686016 bytes, 5800168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes