1

I was wondering is there any way to install Kali Linux on a usb drive instead of my SSD. I have a 32GB flash drive that I want to use instead of an SSD partition. The reason for this is that i want to customize my Kali Linux. It can already boot from a live usb.

closed as off-topic by Jeff Schaller, dr01, garethTheRed, Archemar, Raphael Ahrens Feb 3 '16 at 14:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Jeff Schaller, dr01, Archemar, Raphael Ahrens
If this question can be reworded to fit the rules in the help center, please edit the question.

  • You can create Ubuntu flash drive with its own space, so it would work like a normal OS. However, I would like to note that this will be slow, since USB isn't too fast. – MatthewRock Feb 3 '16 at 11:36
  • I realize that but speed is not exactly my prime concern. I ask because I have tried to do this before, however the OS does not detect the usb drive targeted for installation. Does the flash drive need to be formated to a specific type of file system like ext4? – Emil Zahariev Feb 3 '16 at 11:56
0

you can install it normally !

just boot with your usb pluged in and chose it .

if you want to install it while running your current os then install KVM and use the folowing cmds :

  cdRom=/path/to/kali.iso
  HDA=/dev/sd[x] # e.g /dev/sda (a hd not part like /dev/sda1) use lsblk
  kvm -cdrom "$cdRom" -hda "$HDA" -m 1024 -boot d

you can use this script !

#!/bin/bash
((!EUID)) || exec sudo "$0"
#NOTE : don't use $HOME var in your paths , because the script will restart as root
# which means if you have var=$HOME/file.iso , when script re-exec itself 
# your var will be "/root/file.iso" not "/home/user/file.iso"
xCdImageDirectory=/home/younes/Documents/library/application/x-cd-image
xRawDiskImageDirectory=/home/younes/Documents/library/application/x-raw-disk-image
defaultHardDrive=$xRawDiskImageDirectory/`basename $0`.img #creat a default raw-img if like testing os's
function bootXCdImage() {
  kvm -cdrom "$1" -hda "$2" -m 1024 -boot d
}
function bootXRawDiskImage() {
  kvm -hda "$1" -m 1024
}

echo -n "bootType : 1=>isoImage , 2=>rawImage,   ??: "
read bootType
case $bootType in
  1 )
    echo "pick an XCdImage!"
    ls $xCdImageDirectory/ | nl
    read n
    ((${#n})) && {
    xCdImage=$(ls $xCdImageDirectory/* | sed -n "$n p")
    echo "selected image : $xCdImage"
    } || {
        echo "nothing done"
        exit
    }
    echo "pick a hard drive to use ! sdX or sdXY or empty for default image.img"
    lsblk | grep --color=auto 'sd[a-z]'
    read hardDrive
    [[ -n $hardDrive ]] && {
        hardDrive=/dev/$hardDrive
    } || {
        [[ -f $defaultHardDrive ]] && {
            hardDrive=$defaultHardDrive
        } || {
        echo "$defaultHardDrive does not exist !"
        exit
        }
    }
    echo "selected harddrive: $hardDrive"
    bootXCdImage "$xCdImage" "$hardDrive"
    ;;
  2 )
    echo "pick an XRawDiskImage!"
    ls $xRawDiskImageDirectory/ | nl
    read n
    ((${#n})) && {
        xRawDiskImage=$(ls $xRawDiskImageDirectory/* | sed -n "$n p")
        [[ -f $xRawDiskImage ]] || {
            echo "$xRawDiskImage does not exist !"
            exit
        }
        bootXRawDiskImage "$xRawDiskImage"
        } || {
        echo "nothing done"
        exit
    }
    ;;
  * )
    echo "nothing done!"
    ;;
esac
exit
0

You have to enable persistence in the boot options while booting from the USB drive. This way you will be able to save your settings and data into the USB drive. More information in the official Kali Linux page

  • Yes, but can I install the OS to a flashdrive from a different source, network install or live DVD or another live usb. I ask because I have tried to do this before, however the OS does not detect the usb drive targeted for installation. Does the flash drive need to be formated to a specific type of file system like ext4? – Emil Zahariev Feb 3 '16 at 11:59
  • There's no need to reformat the flash drive with another File System. You will need an external storage to plug into the PC while in the live session. Then, you have to install Unetbootin and select the .iso file from the other USB that you have to mount, by clicking twice on the device in Nautilus. Target the empty drive for the install and let it install – Pavel Rizzo Feb 3 '16 at 12:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.