Hard drive partition management in LinuxPartition DrivesFormat Drives
# fdisk -l
# fdisk /dev/sdx
m (show a list of all fdisk commands)
p (show the current partition table, will be blank on new HD)
n (add partition)
p (primary)
1 (partition number 1, the first partition we make)
enter (just hit enter on the First Cylinder, so default to 1)
+1000M (for last cylinder, this partition will be 1gig in size)
p (there's your new partition, its set to type: linux, we want swap)
t (change the type)
L (list types)
82 (linux swap)
p (now it's linux swap / Solaris type)
n (create new partition)
p (primary)
2 (the second partition were making)
enter (default first cylinder)
+5000M (make it 5gigs)
p (the default Type: linux is good, this can be formated later as ext2 or ext3 or more...)
a (set the boot partition, in this case, our main root linux install partition)
2 (enter 2 for our linux root partition we just made)
p (now you see a star by partition 2 (sdx2), that means it is our boot partition)
n (create new partition)
p (primary)
3 (our 3rd and final partition (the huge home part))
enter (default first cylinder)
enter (default last cylinder, this means, use the rest of the drive for this partition)
p (view your changes before saving)
w (write changes !!! everything will be LOST)
# mkfs.ext3 /dev/sdx2 (this formats our root linux install partition to ext3)
(note: it default to blocksize=4096 and reserves 5% for root use, which is good for this partition)
# mkfs.ext3 /dev/sdx3 -m 0 (this formats our large home partition)
(note: the -m 0 sets the root reserve space to 0%, we want to full space for storage)
e2label /dev/sdx NewDriveName
asdfasdf:/dev# mkfs
mkfs mkfs.cramfs mkfs.ext3 mkfs.msdos mkfs.vfat
mkfs.bfs mkfs.ext2 mkfs.minix mkfs.reiserfs
# mkdir /mnt/newDrive | mount -t ext3 /dev/sdx3 /mnt/newDrive
# chown yourusername /mnt/newDrive/ -R
# chgrp yourusername /mnt/newDrive/ -R