Click Here For Free Windows Downloads
mywindowsdownloads.blogspot.com
Click here for all Free Linux Downloads
mywindowsdownloads.blogspot.com
Click here for all Free Linux Downloads
Many a times, after installation, it becomes necessary to create one or two more ext3 partitions. For example, if added a new hard disk within the system, then you will have to create a new partition. The following steps will be needed to create partitions:
1. Create partition using fdisk or parted utility
2. Format the newly created partition before using it, with the help of mkfs utility
3. Label the new partition using e2label utility, this is optional step
4. Mount this newly created partition within the existing file system
5. Make the mounting permanent by adding the entry in /etc/fstab file
Steps in creating a new partition:
1. Install a fresh hard disk in the system.
2. Boot the system from already installed Red Hat Linux.
3. As root user, type the following command to check whether new disk has been detected:
# dmesg | less
In the output of this command, check for the device name. If the hard disk added was second SATA, then we should see something like sdb:.
Or, you can run the command
# fdisk -l
Some where near the end of its output you should see a line like:
Disk /dev/sdb doesn’t contain a valid partition table
4. Now since you have come to the device name for this hard disk, you can run the following command to open up this hard disk:
# fdisk /dev/sdb
If it is a completely new hard disk, you will see a message telling that this hard disk does not contain a valid partition table, as we saw in the previous command. If it doesn’t show it, this will mean that it is old hard disk.
5. We can get help of all the commands which can be used here. For this just press m on the prompt like Command (m for help):
6. To create new partition type n, as follows:
Command (m for help): n
7. Here you will be asked to choose primary or extended partition. To choose for primary partition, type the following:
Command action
e extended
p primary partition (1-4)
p
8. Now you will be asked for the partition number. If you are creating first partition, type one:
Partition number (1-4): 1
9. Now you will have to tell the cylinder number. Here just press ENTER, to accept default, or specify the desired number:
First cylinder (1-4865, default 1): 1
10. Lastly, either define the last cylinder, if you know, else define the space in MB. Default is last cylinder to use entire hard disk:
Last cylinder or +size or +sizeM or +sizeK (1-4865, default 4865): +5000M
11. Repeat the previous five steps to create more partitions on the disk.
12. Save changes to the disk using w, this will send you back to the shell.
13. At this point of time, to make the changes effective, just restart the system. Instead of restarting the system, you can run the partprobe command as well.
# partprobe
14. Now we will have to make the file system on this partition, i.e. format the partition. To create an ext3 file system on the first partition of this disk, type the following:
# mkfs -t ext3 /dev/sdb1
Alternatively, if you are formatting a partition for Linux swap space, you can use mkswap command, e.g. if you want to setup /dev/sdb2 as swap partition, you can run the following command:
# mkswap /dev/sdb2
15. If you created other partitions also, repeat the above step one by one for all the partitions (like /dev/sdb2, /dev/sdb5 etc.)
16. To use the partition just created, make a directory to mount on it:
# mkdir /home/mydisk
17. Now mount it like this:
# mount /dev/sdb1 /home/mydisk
18. Above method of mounting is temporary, i.e. at next reboot you will again have to mount it before you can use. For mounting it permanently you will need to add an entry, like below, in /etc/fstab file:
# vi /etc/fstab
/dev/sdb1 /home/mydisk ext3 defaults 1 2
In this example, the partition /dev/sdb1 has been mounted on /home/mydisk directory as an ext3 file system. The defaults keyword causes the partition to get mounted at booting time itself. Numbers 1 2 cause the file system neither be dumped nor be checked by fsck.
That is all; you can start using the new partition. Now if you want the above file system to adjust as per your needs, then you can use tune2fs command. Using tune2fs command, you can change the file system error behavior, change volume label, how often the file system be checked or you even can change ext2 file system into ext3 file system so that journaling can be used.
# tune2fs -j /dev/sdb1
This example assumes that /dev/sdb1 was an older partition formatted with ext2. Running the above command will automatically convert this partition into ext3 file system. After you have used tune2fs, you will need to correct your /etc/fstab file to change the system type from ext2 to ext3.
No comments:
Post a Comment