Results 1 to 7 of 7

Thread: Adding persistence to bootable USB Kali live

  1. #1
    Join Date
    2017-Nov
    Posts
    10

    Adding persistence to bootable USB Kali live

    So I tried adding persistence to my usb bootable kali live by running the commands you can find on kali docs adding persistance.

    The proces goes as following

    1)
    fdisk -l

    -> I checked the par***ions already in place

    * on my bootable usb
    Device Boot Start End Sectors Size Id Type
    /dev/sda1 * 2048 30031249 30029202 14.3G c W95 FAT32 (LBA)

    *on my pc (running on windows 10)
    Device Start End Sectors Size Type
    /dev/sdb1 2048 1333247 1331200 650M Windows recovery enviro
    /dev/sdb2 1333248 1865727 532480 260M EFI System
    /dev/sdb3 1865728 2127871 262144 128M Microsoft reserved
    /dev/sdb4 2127872 1269620447 1267492576 604.4G Microsoft basic data
    /dev/sdb5 1269620736 1271472127 1851392 904M Windows recovery enviro
    /dev/sdb6 1417781248 1465137151 47355904 22.6G Microsoft basic data

    So I want to add persistance to my disk and NOT to my pc

    2)
    end=7gb
    read start _ < <(du -bcm /media/root/Windows/Users/thibv_000/Download/kali-linux-2017-W45-amd64.iso | tail -1); echo $start
    parted /dev/sdb mkpart primary $start $end

    -> /media/root/ ... is where I can locate the original kali linux is download file
    (as you can see I use kali linux 2017 w45)

    -> With the last commandline I get this:

    root@kali:~# parted /dev/sdb mkpart primary $start $end

    Warning: You requested a par***ion from 2708MB to 7000MB (sectors
    5289062..13671875).

    The closest location we can manage is 650GB to 650GB (sectors
    1269620449..1269620449).
    Is this still acceptable to you?
    Yes/No? y

    Warning: The resulting par***ion is not properly aligned for best
    performance.
    Ignore/Cancel? i

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

    3)fdisk -l

    * on my bootable usb
    Device Boot Start End Sectors Size Id Type
    /dev/sda1 * 2048 30031249 30029202 14.3G c W95 FAT32 (LBA)

    *on my pc (running on windows 10)
    Device Start End Sectors Size Type
    /dev/sdb1 2048 1333247 1331200 650M Windows recovery enviro
    /dev/sdb2 1333248 1865727 532480 260M EFI System
    /dev/sdb3 1865728 2127871 262144 128M Microsoft reserved
    /dev/sdb4 2127872 1269620447 1267492576 604.4G Microsoft basic data
    /dev/sdb5 1269620736 1271472127 1851392 904M Windows recovery enviro
    /dev/sdb6 1417781248 1465137151 47355904 22.6G Microsoft basic data
    /dev/sdb7 1269620448 1269620448 1 512B Linux filesystem (!!!!!!!)

    -> So my question now: as you can see there is an extra par***ion of 512B Linux filesystem.
    Is that correct?
    Does the extra par***ion need to come on my computer (and not my usb)
    If the extra par***ion needs to come alongside my par***ion on my bootable usb, what should I do different?

    -> Can I chose the amount of Bytes myself?

    4)
    mkfs.ext3 -L persistence /dev/sdb3
    e2label /dev/sdb3 persistence

    mkdir -p /mnt/my_usb
    mount /dev/sdb3 /mnt/my_usb
    echo "/ union" > /mnt/my_usb/persistence.conf
    umount /dev/sdb3

    -> those are the commands linux docs says I need to do next but I those don't work because the par***ion is created on my pc instead of my USB.


    extra info:

    * kali-linux-2017-W45-amd64
    * written by rufus on my usb stick (16GB)



    Thanks in advance

    th-vb

  2. #2
    Join Date
    2013-Jul
    Posts
    818
    MTeams sees you are using windows 10. Suggest you refer to these two(2) links as appropriate.

    https://forums.kali.org/showthread.p...-0-flash-drive

    https://forums.kali.org/showthread.p...stence+windows

    We just retested these steps for kali linux 2017R2 and they continue to work for us.

    Musket Teams

  3. #3
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    867
    Your hard drive name is /dev/sdb and you want to add persistence in your USB whose name is /dev/sda so why are you applying the operation on your hard drive? It should be /dev/sda.

  4. #4
    Join Date
    2017-Nov
    Posts
    10
    @_defalt

    Your remark was certainly correct, so I tried with the right commands and write drive names.
    Everything works out just fine until after step 3 (=parted /dev/sda mkpart primary $start $end)
    -> then my computer asks me to reboot so I do. The reboot is still functional at that time.

    I enter the other steps as discribed here

    mkfs.ext3 -L persistence /dev/sdb2
    e2label /dev/sdb2 persistence

    mkdir -p /mnt/my_usb
    mount /dev/sdb2 /mnt/my_usb
    echo "/ union" > /mnt/my_usb/persistence.conf
    umount /dev/sdb2

    *after the reboot the name is /dev/sdb (but I don't think that is an issue)
    *what I don't know is whether I should use ''my_usb" OR the real usb name
    -> If I should use the real usb name where can I find it? (is it just the name like 'sandisk' or 'cruzer'

    I come to you with this other problem because if I reboot after my last command Kali won't start Kali live nor Kali live with persistence and I have to re-write it.

    Hopefully you can help me, you have been a great help in the past.

    Kind Regards

    th-vb

  5. #5
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    867
    OS doesn't recognize USB with your given name. OS assigns its own name to the storage device. You should use /dev/sda or /dev/sdb whatever the name you see in fdisk -l.

  6. #6
    Join Date
    2017-Nov
    Posts
    10
    I tried doing that and this is what I got

    mkdir -p /mnt/dev/sdb
    mkdir: cannot create directory ‘/mnt/dev’: No space left on device

  7. #7
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    867

Similar Threads

  1. Replies: 0
    Last Post: 2016-12-15, 01:24
  2. Replies: 10
    Last Post: 2014-11-13, 23:02
  3. Adding Persistence to a Kali Live USB, some questions
    By Beholder42 in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2014-09-21, 18:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •