How do you create a partition with fdisk?
I'm trying to install Slackware Linux on a virtual machine. Basically, the first step is to boot from the ISO file for the Slackware installer; after that you log in as root, and you can access all of the basic Slackware executables and other files on the install disk. I could do this every time - just boot Slackware from the install disk - but I wouldn't be able to create files or use any of the more advanced packages this way, so I need to install Slackware to the virtual hard drive. Before I do this, I need to use fdisk to create a partition table. The only program I've ever used to partition a drive in the past is GParted, so this would be a valuable learning experience - learning how to partition a drive from the command line. It's also a major challenge, as I don't know how to create multiple partitions on a drive using this method. To do this I would need some way to specify the size and/or starting point for each partition I create; otherwise fdisk would just create one huge partition, and that's not what I want. I want to create three partitions - one for booting, one for the main filesystem, and one for a swap space. I've read the man page for fdisk and can't find any indication for how to specify partition size or starting points. I'm asking anyone here who has used fdisk before to help me learn the ropes of this program.
Also, I apologize for the gigantic paragraph. I couldn't find any way to divide it.
Start fdisk as root with the command:
(using sda as target device- change to suit your needs)
fdisk /dev/sda
At that point you will have the following options:
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
When you use option 'n' you will be asked to specify partition type, partition # , start/stop sectors, and partition size.
Once you've set up your partitions you can set the type (swap, etc,) with option 't' (use 'l' to list available types)
Use 'p' to verify your work before finalizing with 'w'
_________________
Without deviation from the norm progress is not possible.
-Frank Zappa
Similar Topics | |
---|---|
Why create groups of people based on their age ? |
12 Jan 2024, 2:33 pm |