Use examples when they help make things clearer.
Let me break it down for you like a boss. So, creating manually partitions on Kali Linux can be a bit daunting if you’re not familiar with the process. No worries, though, my friend! I got your back. First things first, we need to open up our trusty terminal and type in “sudo fdisk /dev/sdX” (replace sdX with the name of your hard drive). This will bring us into the command-line interface for partitioning. From here, you can create new partitions or modify existing ones using a variety of commands. For example, let’s say we want to add a 10GB swap partition at the end of our current setup. We would type in “n” (for “new”) and then follow up with some additional options like:
– p for primary partition (the default)
– Enter to accept the first suggested cylinder number
– +10G to specify a size of 10GB
– t to change the partition type code
– ef02 to set it as a Linux swap area
– w to write changes and exit fdisk. Once we’ve completed these steps, our new swap partition will be ready for use! But what if we want to create an encrypted LUKS partition instead? No problem! We can do that too by following the same basic process but with a few extra commands:
– n (for “new”)
– p (for primary)
– Enter (to accept default cylinder number)
– +10G (to specify size of 10GB)
– t (to change partition type code)
– 8e (to set it as a LUKS container)
– w (to write changes and exit fdisk). After that, we’ll need to initialize the new LUKS partition with “sudo cryptsetup luksFormat /dev/sdX3” (replace sdX3 with your chosen partition number), followed by opening it up for use with “sudo cryptsetup luksOpen /dev/sdX3 my_usb”. And that’s pretty much it! You can now create and format partitions to your heart’s content, whether you need a swap area or an encrypted LUKS container. Just remember to always back up your data before making any major changes, just in case something goes wrong. But what if we want to add more than one partition at once? Or modify existing ones without having to exit and re-enter fdisk every time? Well, that’s where the “c” command comes in handy! By typing “c” (for “change”) followed by a number corresponding to an existing partition, you can modify its type code or other properties. For example:
– c 2 (to select the second partition)
– t (to change the partition type code)
– ef07 (to set it as a BIOS boot partition)
– w (to write changes and exit fdisk). This allows us to create multiple partitions at once, or modify existing ones without having to reboot our system. And in case one partition gets corrupted, you don’t need to worry about data on other partitions because each partition is treated as a separate disk! The fdisk utility is a powerful tool for the task of managing disk partitions, but it can often be confusing for new users. We hope this tutorial was able to help you understand how to create and modify partitions in Linux using the fdisk utility. If you have any feedback, queries or suggestions, feel free to reach out to us in the comments below!