Rootsmart Podcast #39 6/14/06




RootSmart.com Tech Podcast show

Summary: Content Today we are talking about partitions and disks in Linux Disks are not handled in the same way that Windows handles disks In linux disks are handled as mount points So in windows you have drives C:, D: whatever in linux you have mount points So lets say you have two partitions, A and B You want your home folder to be on a seperate partition, A so you set the mount point of partition A to be /home so you can be using your home folder without ever realizing it is a seperate drive this makes the use of other drives very transparent so to see what drives you have plugged in, we need to check a file the file is located in the /etc directory called fstab this will have lines that look like /dev/hda1 / ext2 defaults, errors=remount-ro 0 1 ok so you don't need to worry about the stuff after ext 2 the first thing says the device in this case it is the first partition on the first channel of the master IDE channel hd means it is a IDE drive a means it is the Master channel on the 1st IDE channel the 1 is the partition if you want the drive on the slave on the first IDE channel you can go to hdb as for sata drives, you get sd drives sd stood for SCSI now sata runs on the same devices as SCSI this uses the same scheme the next entry in the fstab is the / that is the mount point, this is loaded at the root and the next is ext2 that is the filesystem ext2 and ext3 are very common so now we are going to go over partitioning a lot of the times, I recommend this to be done graphically you don't want to make a mistake, and a typo could be a massive mistake but we are focusing on command line, so let me show you how to do this I am going to assume that we are working on the HDA drive so to see what is on the HDA drive type fdisk /dev/hda this will print out the amount of cylinders and all kinds of other info the cylinders are used mainly for size, but don't worry too much about it so first lets go over deleting partitions type fdisk /dev/hda then at the prompt type p this gets you a reference now type d and choose a partition to delete now we want to create a new partition type n choose extended or primary you probably want primary the reason for this is that standard PCs only allow four partitions these are primary partitions if you want/need more you need to create extended partitionso so now at the number field type in that same number that you deleted now at the cylinder, choose how large, so you can do +5000M to create something that is 5 gigs now type t this will ask what is the Hex code and if this is a linux partition choose 83 if it is a swamp file choose 82 now type p you should see everything all right now this is the big step no changes have been written yet so, make sure you know what you are doing now type w and you are done since we are on drives, let me go over filesystems filesystems are the way that a OS will find files, and information on those files on the drive Linux supports hundreds of file systems but here are the most common ext2 is a ver fast filesystem, that defragments itself its newer cousin is ext3 which is fast and defragments and also is journaled journaled means that if your system crahses, or has an abrupt stop, such as when you pull the cord it probably wont' lose any data ISO9660 is what is used on all CDs FAT is a very common filesystem that can be read by OS X, Windows, and Linux ResiserFs is a new filesystem optimized for smaller files it is used by SuSe heavily so you can't mount the partition you just created yet it needs a filesystem to do this we say mke2fs -j /dev/hda1 you then put it what partition you want the j option makes it ext3 ok so if you want to mount this drive in the /home directory you would type mount -t ext3 /dev/hda1 /home/ the -t ext3 chooses what filesystem to unmount this type unmount /home/ That is drives in Linux for you one more of these and then we are done for the linux for a while