Thursday, March 14, 2013

Create a new ext3 file system if a disk was added to the sys


How do I create a new ext3 file system if a disk was added to the system?

Resolution:

1. Create the partition using the fdisk command. To start fdisk at a shell prompt (as root), type the command: Quote: fdisk/dev/hdb where /dev/hdb is the device name for the drive you want to configure.

The Command (m for help): prompt is displayed. Type n then p, to create a new (n) primary (p) partition. You will then be asked to enter a partition number 1-4. You can only have a total of 4 primary partitions. If you need more than 4 partitions, then your 4th partition will become your extended partition and you can create up to 15 partitions that the system will recognize. You will then enter the size of the partition that you want to create. The easiest way to do this is to select the defaulted start cylinder, then issue a size based on MB. Example: +5000MB to create a 5 GB partition.

2. Format the partition with the ext3 file system using mke2fs. Note that an ext3 file system is an ext2 filesystem with journaling (the -j option). See man mke2fs for more options. Type:

/sbin/mke2fs -j /dev/hdb3

where /dev/hdb3 is the partition you want to format. Note: If mke2fs does not recognize your partition, then you must reboot your system so that the new partition table is recognized.

3. You can label the partition using e2label. For example, if you want to label the new partition /work, type

e2label /dev/hdb3 /work

4. As root, create the mount point:

mkdir /work

5. As root, edit the /etc/fstab to include the new partition. The new line should similar to the following:

LABEL=/work /work ext3 defaults 1 2

6. Reboot your system so that the new partition table is recognized.

No comments:

Post a Comment