I want to install Kali Linux on a 64 GB USB drive and want to take it just anywhere and plug it in any PC and have my setup up and running. IOW I just want a HDD like complete Kali Linux portable installation on a USB.
I don't want Live boot or persistence or anything, I clearly want to install it on that USB just like we normally install Kali Linux on HDDs.
I would like to give some information about my internal HDD -
root@Kali:~# fdisk -l Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Disk model: ST500DM009-2F110 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 0BBC9B99-EE7E-11E8-8BD6-843C86F9DFC6 Device Start End Sectors Size Type /dev/sda1 2048 1126399 1124352 549M Microsoft basic data /dev/sda2 1126400 210561023 209434624 99.9G Microsoft basic data /dev/sda3 210561024 210765823 204800 100M EFI System /dev/sda4 210765824 315623423 104857600 50G Linux filesystem /dev/sda5 315623424 328206335 12582912 6G Linux swap /dev/sda6 328206336 537921535 209715200 100G Linux filesystem /dev/sda7 537921536 976773134 438851599 209.3G Microsoft basic data Disk /dev/sdb: 57.9 GiB, 62109253632 bytes, 121307136 sectors Disk model: Ultra 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: BC1A35EC-FF80-4CCB-BD61-30F7FF3CDA4A Device Start End Sectors Size Type /dev/sdb1 2048 206847 204800 100M EFI System /dev/sdb2 206848 68567039 68360192 32.6G Linux filesystem /dev/sdb3 68567040 76380159 7813120 3.7G Linux swap /dev/sdb4 76380160 121305087 44924928 21.4G Linux filesystem
/dev/sda is my internal HDD with Windows 10 + Manjaro installed on it in dual boot in UEFI mode.
/dev/sdb is the target 64 GB USB drive on which I want to install Kali Linux. What you are seeing here in
/dev/sdb is the current installation of my Kali Linux (my 3rd try).
I downloaded the Kali Linux KDE 2019 ISO from the official Kali Linux Downloads page, used Rufus to make a Live boot in DD mode in another spare 16 GB USB. I deleted all the partitions on the target USB and made it unallocated. Booted from the Live USB, selected Graphical installer, went through all the process until Partitioning.
I chose Manual partitioning method, then partitioned my target USB (shown as
/dev/sdc in the installer) as follows -
SCSIl (0,0,0) (sdc) - 62.1 GB > 1.0 MB FREE SPACE > #1 /dev/sdc1 104.9 MB B K ESP EFI system partition > #2 /dev/sdc2 35.0 GB f ext4 / > #3 /dev/sdc3 4.0 GB f swap swap > #4 /dev/sdc4 23.1 GB f ext4 /home > 1.0 MB FREE SPACE
I checked everything especially the bootable flag "on" in EFI partition. After making sure everything was right I proceeded with the installation. One unusual thing I did notice after clicking Continue was I only created 4 partitions on my
/dev/sdc, but there were 5 partitions listed under "partitions to be formatted", I examined and found that along with the 4 newly created partitions on
/dev/sdc , the
swap partition on
/dev/sda was also listed to be formatted there. I thought that is strange as I didn't even touch
/dev/sda while partitioning, but I ignored it and clicked Continue. The system got installed successfully, finished the installation and rebooted. Also took out the Live USB stick.
So far so good.
Got the grub screen, selected Kali and boom! The first thing I encountered was a black screen with (initramfs) as the grub failed to find root partition on
/dev/sdc (NOTE: While installation the target USB was
/dev/sdc , but after removing Live USB stick it became
/dev/sdb ). So I went back to grub by rebooting and pressed "e" and changed the device path for root from
/dev/sdb2. Pressed F10 and that booted me into my Kali Linux desktop, YAY!
Well, not so yay. I just fired up GParted to check whether all my partitions are intact, and to my surprise I saw that instead of the EFI partition that I created on
/dev/sdb, the EFI partition of
/dev/sda was mounted, the root, swap & home partitions on
/dev/sdb were mounted and the swap partition on
/dev/sda was mounted too! WTF!
Also the EFI partition on
/dev/sdb which was expected to be mounted at
/boot/efi was not mounted!
This just got my head spinning, I tried the above step one more time but got the same result. Then I read somewhere that the EFI partition must already be present on the target USB drive, so I tried that too but no result.
So I shutdown the system and plugged the USB in a different laptop to see whether it works, but as soon as I fire up the boot menu there is no option to boot from USB. I tried disabling Legacy support & Secure Boot. Also tried to Add a boot option but there is no EFI file available in the file system of the USB. The EFI file for Kali is available with Manjaro and Windows in the file system of my internal HDD which clearly shows that the EFI files got installed on the EFI partition of
I need to find out what's happening here, what's going wrong, how can I fix this, and how can I fulfill my aim mentioned above.