Closed LinuxJunkie closed 10 years ago
I have been running ubuntu and kali successfully from an sd card for months (I found that to be quicker than usb). You will need to format it as an ext file system. Rather that symlinking home, I would suggest symlinking the chroots folder so the entire chroot is run from the sd card/usb stick. To do that -
enter “cd /usr/local”
enter “sudo mkdir /media/removable/<name of your device>/chroots”
enter “sudo ln -s /media/removable/<name of your device>/chroots/ chroots”
then you can install your chroots as if installing on the internal ssd
the other issue you may face is that since the recent update to chrome os, the system will not auto mount external drives formatted to an ext file system. It will complain that it is an unsupported file system. However I have tried and it can be mounted from the shell
I used sudo mount /dev/sdb1 /media/removable/sd_crouton/
sd_crouton is the name of my sdcard and the mount point is created automatically by the system even though chrome os nolonger mounts it. /dev/sdb1 is the partition on my sd card, using usb may be a different drive eg /dev/sdc1 .
Thank you for the advice. I done the steps you advised me to do to make the symlink. It did make a symlink, but I still did not reach my objective with trying to gain more space and a faster USB drive with the chroot on it.
I changed to the local directory with the following command:
"cd /usr/local"
After I had issued the last command, I made the new directory with the following command:
"sudo mkdir /media/removable/USB\ Drive/chroots"
Then, I issued the next command that you advised me to use in order to symlink my USB drive chroots folder to my chroots folder on my Chromebook:
"sudo ln -s /media/removable/USB\Drive/chroots/ chroots"
Side Note: The above command would had been better issued after step 13 from the section below.
With that process finished though, I started the installation of Kali Linux through crouton to my USB drive with the following procedure:
I opened up the crosh window and moved in to the Chromebook shell by typing "shell". Then, I pressed the enter key. Once that was completed, I had downloaded crouton to be able to install Ubuntu/trusty-unity on my Chromebook, so I could enter the chroot and use the parted tool. It seems that Chromebook developers had removed the parted tool as well as the support for ext4 file system.
Anyway, I used the following command to install Ubuntu/trusty-unity to my machine:
"sudo sh -e ~/Downloads/crouton -r trusty -t unity".
After the installation of Ubuntu, I had to set my user name and password. I also had to move into the chroot environment from the shell. The command I issued was the following:
"sudo enter-chroot"
Once I was inside my chroot environment I plugged in my USB drive and I issued the command, "sudo umount /dev/sdb*. I continued from here by typing, "sudo parted /dev/sdb" into the chroot environment terminal, so I could enter into the parted tool and make a msdos partition table.
I made the msdos partition table by typing, "mktable msdos" within the parted tool. From here the tool informed that the existing partition table of /dev/sdb is going to be destroyed and all the data will be lost, and it had asked me, "Do you wish to continue?" I typed the word "Yes" and I pressed the enter key. After that, I closed it out by typing the letter "q" and tapping the enter key.
Next, I rebooted the the Chrombook, and I opened the shell to use the fdisk tool to create a partition on my dev device. I issued the following command to use fdisk on the USB drive: "sudo fdisk /dev/sdb". From with in the tool, I used the following letters, numbers, and keys in the following order to complete the task. I used "n" to create the new partition. The letter "p" for it to be a primary partition. The number "1" to assign a partition number.
Then, I pressed the enter key to use the default start point for assigning where the sectors will begin on the device. I also pressed the enter key again to assign the default value for where the sectors will end. I also typed the letter "v" to verify the partition table and the letter "w" after that to write the partition table.
Also, I had to check my work and create a new file system on the USB drive. I done this procedure with the following steps:
Step 1. I typed "sudo fdisk -l" to check my work. Everything was good. It had showed the start, the end, the blocks, the Id, and the system correctly.
Step 2. I unmounted the USB Drive with the following command:
"sudo umount /dev/sdb".
Step 3. I made the ext4 file system on the USB Drive with the following command:
"sudo mke2fs -t ext4 /dev/sdb1".
Step 4. I remounted my USB Drive with the following command:
"sudo mount /dev/sdb1 /media/removable/USB\ Drive"
Step 5. I rebooted the computer.
Step 6. I ejected the USB drive through the file system, and I removed it. Then. I inserted it into the USB port again.
Step 7. I remounted the USB Drive with the following command:
"sudo mount /dev/sdb1 /media/removable/USB\ Drive"
Step 8. I had checked to see if the USB drive was mounted properly with the following command:
sudo mount | grep "sdb"
Step 9. I made sure I had the crouton downloaded from Github.
Step 10. I installed Kali Linux to my USB drive with the following command:
"sudo sh -e ~/Downloads/crouton -r kali -t kde -p /media/removable/USB\ Drive"
Step 11. I created the root user name and password for Kali Linux.
Step 12. I changed the directory to my USB drive and ran the following command to start Kali Linux: "sudo bash startkde -b".
Note: A person can change the directory to the USB drive by typing, "cd /media/removable/USB\ Drive/bin", and pressing enter.
Step 13. I installed all of the Kali Linux tools once I had logged into the chroot with the following command:
"sudo apt-get install kali-linux-full"
With this being said, I do have Kali Linux fully up and running from my usb Drive, but when I issue the command "df -h" I do not see the extra size in the Downloads folder. So, "is there a way I can issue any commands to delete the symlinks?" If there is a way, "what are the commands to accomplish the deletion of them?"
Also, "what would be the command to make the symlink to link the usb free space and the Chromebooks' free space?" I mean, "is it even possible to do that?" Any how, I think I will just try to make the USB faster though by adding a swap partition and turning it on. I still would like to gain extra space though by symlinking.
Once again, thank you to anybody who helps me with what I am wanting to accomplish.
I'm not sure I understand your reason for installing Ubuntu and using parted. Making the ext4 usb drive only needs the steps with fdisk and mke2fs/mkfs.ext4. After doing that, symlink the chroots folder then to a folder on the new ext4 partition on the usb drive and install kali without the need to use -p, as the symlink is already diverting the default chroots folder to the usb drive (check with sudo edit-chroot
the description for -c shows the default chroots folder). Then you can start kali with sudo startkali
and everything in kali will be in the chroot folder on your usb drive, (except for the downloads folder, that is shared with the chrome os).
Its not possible to my knowledge to join the space of 2 drives using symlinks, though I guess you could probably symlink the downloads folder to a usb drive if you really wanted, but im not sure its worth the bother. Maybe you should look at http://www.nixtutor.com/freebsd/understanding-symbolic-links/ . What you are wanting is 1 partition to span 2 drives, like a RAID. Not practical here, and even if you managed it I would expect the usb drive to cripple the performance. If I remember correctly, for me usb was about half the speed of sd card and that was about 1/10th of the speed of the ssd, but fast enough to work for me. I can check my speeds if you like, but if speed is necessary and you really want to increase the size of the downloads folder, you'll need to replace the internal ssd.
Deleting symlinks is like any file with rm
Right. I am starting to believe that it is not possible to gain extra space by symlinking folders from two different drives. I also have decided to not try to make a swap file on the USB drive to speed it up. I think I would lose data, and it would ruin my USB drive more fast. I do thank you though for all of the help.
I had learned a little bit from this discussion. I am also sure some others will learn something from it too. There are some pretty good steps in these posts about how to do a couple of things. Anyway, there is no more need to keep posting here, so I am closing it out.
I am wanting to install Kali Linux through crouton with the kde desktop, and I want to symlink the home folder of Kali Linux to a removable USB drive that has a home folder created on it that is named "extra-home" and a sub-directory of my username within it. This way I can gain some extra space to do the full Kali Linux installation on my 16GB Chromebook through crouton instead of removing chrome os to do it.
I would rather keep chrome os long side of another Linux distribution and have it symbolically linked to a USB drive to practice different types of developing techniques. I know this symbolic link idea sounds messy, but if it is possible, I would greatly appreciate the help on achieving this goal.
Anyway, when I try to symlink my Kali Linux home folder to my USB drive, I get permission denied. I had figured out that fat32 file system will not allow that operation to happen. Is there a way I can chmod my usb drive if I turn it into a ext4 file system? On top of that, how can I mount my USB stick manually though my chroot environment once I have formatted it to ext4 file system?
I am thinking that the command to create the symlink will look something like the following: "sudo ln -s /home/username /media/removable/UNTITLED/extra-home/username". Is this correct? Thank you for any help in advance.