Results 1 to 6 of 6

Thread: Howto HDD installation on a USB key

  1. #1
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580

    Post Howto Install HDD Kali on a USB Key

    This, to install Kali Linux on a USB key(pendrive) just like on a hard disk drive(HDD). This installation permits for core files to be updated, such as drivers. If you do not need to update core files, keep using the standard LiveUSB method. This will be a work in progress as new and better ways will surface with users input/pointers.

    Updated 12 Feb 2015. Now using the 'Graphical Install' from the Kali boot menu.

    Updated 5 July 2014. Now using ext4 non-journaling filesystem..

    http://en.wikipedia.org/wiki/Ext2
    " ext2 is still the filesystem of choice for flash-based storage media (such as SD cards, and USB flash drives), since its lack of a journal increases performance and minimizes the number of writes, and flash devices have a limited number of write cycles. Recent kernels, however, support a journal-less mode of ext4, which would offer the same benefit, along with a number of ext4-specific benefits. "

    Steps 21-32 added to disable journaling on ext4 partition.

    This installation method requires to physically unplug the hard disk drive(HDD) before the installation process, as I could not find a way to prevent GRUB(or the installation program) from writing on HDD boot sector, making my Windows installation dependent on the newly created Kali USB key to start it, and when I fixed the boot sector with the Windows7 installation disk with 'fixmbr', then Kali wouldn’t start on that USB key. Welcome to the Wonderful world of Linux...

    The second post below, is a straight-to-the-point guide. You might want to refer to the official Kali Linux Hard Disk Install also, as it is for the most part the same procedure.

    For this installation you will need:

    Two(2) USB keys(pendrives). One (USB key A) with KaliLinux already installed on it as a normal LiveUSB, the other one (USB key B) empty, formatted as:

    • The first partition is a Primary, FAT32, to permit usage under Windows. If you do not intend on using that USB key in Windows, you do not need to create a FAT32 partition.
    • The second partition is a Primary, Ext4, to install Kali on. A basic installation without updates is about 8Gb, so 14Gb in size or greater is recommended to allow for updates and software installations.
    • The third partition is a Logical, Linux swap. That last partition(Linux swap) must be equal or greater than the amount of RAM on the system(computer).

    *a 32Gb USB 3.0 pendrive comes to mind here*



    Good luck!
    Last edited by Quest; 2015-02-12 at 16:22.
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  2. #2
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580
    Steps 1-8

    1. USB key B should be partitioned as mentioned above, using a partition software of your choosing.

    2. shut down the computer, and physically remove the hard disk drive(HDD) if it is a laptops, or unplug it if it is a desktop. The hard disk must be non-existent on the system during installation in order for the USB key installation to be standalone.

    3. start the computer with the Kali USB key A, and USB key B plugged in.

    4. boot on the Kali USB key A selecting the Graphical Install option from the menu.

    5. Select a language | Select location | Configure the keyboard.
    6. Network. Don't bother at this point.
    7. Host name Kali or other name. Domain name leave blank.
    8. Root password toor


    Installation 9-20

    9. select Manual.
    10. double click on the Ext4 partition.
    11. double click on “Use as” and select ext4 filesystem.
    12. double click on format partition: yes, format it.
    13. double click on mount point. Select /-the root filesystem.
    14. Label: Kali or other name.
    15. click on Done setting up the partition.
    16. click on Finish partitioning and write changes to disk.
    17. check if information is correct. Select "yes" when done.
    Copying data to disk...
    18. Use a network mirror. Yes/No
    Scanning the mirror...
    19. Install boot loader. Yes. (mine said /dev/sdc).
    Finishing the Installation...
    20. reboot on that newly created KaliLinux USB key B. Login with user: root, password: toor. Shut down the computer and reinstall/reconnect the hard drive.

    Disable ext4 Journaling 21-32
    You do not need to follow these steps if you are using an ext2 filesystem as it is already non-journaling.

    21. boot on to Kali with USB key A.

    22. once booted on the Kali desktop, plug in USB key B. It should be mounted.

    23. check the name of the USB key B ext4 partition with Disk Utility. Applications > Accessories > Disk Utility. Take note of the name of that partition. Mine was 'sdc2' yours might be named differently. I will use 'sdc2' for the rest of this procedure. You should copy/paste this section and replace every instance of "sdc2" with your ext4 partition name, not to get confused.

    24. to see your ext4 filesystem partitions, run the following command.
    Code:
    dmesg | grep EXT4
    It should look like this:
    root@kali:~# dmesg | grep EXT4
    [ 7.091904] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)
    [ 19.542421] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)
    [ 22.795836] EXT4-fs (sdb2): warning: mounting fs with errors, running e2fsck is recommended
    [ 22.906943] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
    [ 77.202153] EXT4-fs (sdc2): mounted filesystem with ordered data mode. Opts: (null)
    [ 323.393770] EXT4-fs (sdb2): error count: 2
    [ 323.393791] EXT4-fs (sdb2): initial error at 1401232973: ext4_mb_generate_buddy:756
    [ 323.393796] EXT4-fs (sdb2): last error at 1401321132: ext4_mb_generate_buddy:742
    [ 1024.978481] EXT4-fs (sdc2): mounted filesystem with ordered data mode. Opts: (null)
    [ 1099.401035] EXT4-fs (sdc2): mounted filesystem with ordered data mode. Opts: (null)
    [ 1908.512722] EXT4-fs (sdc2): mounted filesystem with ordered data mode. Opts: (null)
    there shouldn't be any mention of "filesystem without journal" on 'sdc2' at this point.

    25. unmount the ext4 partition 'sdc2' with Disk Utility.

    26. check if everything is ok with that partition.
    Code:
    e2fsck -f /dev/sdc2
    It should look like this:
    root@kali:~# e2fsck -f /dev/sdc2
    e2fsck 1.42.5 (29-Jul-2012)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    Kali7_x64_64G: 350355/1982464 files (0.1% non-contiguous), 2048271/7919872 blocks
    27. disable etx4 journaling on 'sdc2'.
    Code:
    tune2fs -O ^has_journal /dev/sdc2
    28. reboot the computer on USB key A again.

    29. unmount the ext4 target partition 'sdc2' with Disk Utility, again.

    30. check if everything is ok with that partition.
    Code:
    e2fsck -f /dev/sdc2
    31. mount the ext4 target partition 'sdc2' with Disk Utility

    32. run dmesg again to check if journaling is disabled for the filesystem.
    Code:
    dmesg | grep EXT4
    It should look like this:

    root@kali:~# dmesg | grep EXT4
    [ 6.947376] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)
    [ 18.786956] EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: (null)
    [ 20.481343] EXT4-fs (sdb2): warning: mounting fs with errors, running e2fsck is recommended
    [ 20.591972] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
    [ 258.185622] EXT4-fs (sdc2): mounted filesystem without journal. Opts: (null)
    [ 321.345429] EXT4-fs (sdb2): error count: 2
    [ 321.345438] EXT4-fs (sdb2): initial error at 1401232973: ext4_mb_generate_buddy:756
    [ 321.345443] EXT4-fs (sdb2): last error at 1401321132: ext4_mb_generate_buddy:742
    [ 1369.798492] EXT4-fs (sdc2): mounted filesystem without journal. Opts: (null)
    notice the "mounted filesystem without journal" now on 'sdc2'.

    You now have a standalone, bootable, upgradable, KaliLinux installation on something that you can ware :]
    Last edited by Quest; 2015-02-12 at 18:03.
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  3. #3
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580

    Extras

    These are just some extra steps. You might want to make your own list.



    After Installation

    • After a successful installation, you may want to copy the Ext4 partition to prevent having to go trough the installation process again. I used Acronis True Image 2014 to create and save the image of my Kali installation.

    • Kali Linux updates.
      Code:
      apt-get update && apt-get dist-upgrade
    • Install drivers.

    • Reaver dependencies.
      Code:
      apt-get install libsqlite3-dev && apt-get install libpcap0.8-dev
    • All dependencies.
      Code:
      apt-get -f install



    Customization

    • Configure Iceweasel: bookmarks, startpage, tool bar, settings, dictionaries. Kali settings: Internet connections. Lock off. Computer icon: Application>System Tools>dconf Editor>org>gnome>nautilus>desktop.
    Last edited by Quest; 2015-02-26 at 17:39.
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  4. #4
    Join Date
    2014-May
    Posts
    31
    I have only one USB stick 32G Cruzer Glide. In win7, I partition the stick give to it 8G for Boot2Menu and installed . I dropped Kali.ISO into Linux menu. Boot computer from the stick. Go to Linux menu and "hit" on Kali.iso. Start the live andd go for install. In partition menu does show my stick with "free space"(21G). Choose to install to that partition and put grub on sdb0. That was all. After the install, boot from the stick and have Kali working, but slow as ****. The stick itself is slow. I did had it pug in USB3. After the grub install, I could not access the boot2menu, but not a big deal. If you have Kali on dvd, then just wipe the partition on usb - do not format. Kali will do it. I have Kali on my hdd as main OS. That was just a test and worked OK.
    USB stick are slow and if you are affraid to mess your hdd and willing to put up with the slow process, go for it.

  5. #5
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580
    Though it is true that such installation on a USB2 key would slow, my installation on USB3 key is very fast and I couldn't be happier with the results.

    Benchmark (Applications > Accessories > Disk Utility)
    Read max 207Mb/s
    Read avr 204Mb/s

    I'm using a Kingston DataTraveler Ultimate 3.0 G3 64Gb, and so far I cannot tell the difference in performance between that and HDD. Actually the pendrive installation might be faster, but there is no way for me to prove it now. Might do some test in the future.

    Careful with 3.0 keys! Unlike the 2.0, they are not created equal. Check the read/write specs before buying one.
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  6. #6
    Join Date
    2013-Aug
    Location
    lost in space
    Posts
    580
    12 Feb 2015.

    Step 1-8 above in post #2, simplified. Choose 'Graphical Install' from the boot menu, instead of installing from the Kali desktop Application menu.
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

Similar Threads

  1. Howto live usb on a uefi32 and X64 HW :confused:
    By snoopy1949 in forum General Archive
    Replies: 3
    Last Post: 2016-12-27, 06:49
  2. Howto frankenScript
    By Quest in forum How-To Archive
    Replies: 255
    Last Post: 2016-02-09, 23:37
  3. Kali 2.0 USB persistent: old howto no more valid
    By ovosodo in forum Installing Archive
    Replies: 5
    Last Post: 2015-08-15, 09:45

Posting Permissions

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