It is particularly worth mentioning that the Linux operating system has many things worth learning. Here we mainly introduce the Linux operating system, including the Linux operating system. To add a new ext3 File System for Linux, you may need to create a new ext3 file system. For example, if you want to add a new hard disk to a Linux operating system, you may want to partition the hard disk and use the ext3 file system. This article describes how to create an ext3 file system after adding a hard disk to a Linux operating system.
1. Introduction to ext3 File System
The Linux operating system starts from the Red Hat Linux 7.2 release. The default file system has been converted from the ext2 format to the registered ext3 file system. In general, we can think that the ext3 file system is an improved version of the ext2 file system. These improvements provide the following advantages:
The availability of the Linux operating system is determined by the report registration method provided by the ext3 file system, which means that the Linux operating system does not need to be continuously checked after the unclean system is shut down. Consistency check only occurs when some rare hardware failures, such as hard drive failures, occur. Data Integrity ext3 the file system provides more robust data integrity when an unclean system is sent for shutdown.
Speed although ext3 writes data more than once, its total processing capability is still higher than ext2 in most cases. Simple conversion can easily convert ext2 to ext3 without reformatting, so as to obtain the superiority of a robust registered file system. Currently, the default file system format for Linux operating system partitions is ext3.
Ii. Linux operating system experiment scenarios
HOST: Virtual Server 2K5 R2 memory: 512M Hard Disk: hda 6 Ghdb 4G Operating System: Fedora 2 lab requirement: add the second hard disk hdb to the operating system and divide it into two areas, hdb1 is mounted to/home, And hdb2 is mounted to/home/zheng.
Tutorial steps:
1. Use fdisk to create a partition;
2. format the partition into an ext3 System Using mkfs;
3. Use e2label as the partition label;
4. Create a mount point;
5. Add the partition to the/etc/fstab file.
Iii. Linux operating system experiment process
1. Use fdisk to create a partition. We found that hdb has been added to the system, but no partition is performed. Use the fdisk command for partitioning: Fdisk/dev/hdb divides hdb into two zones, each of which is 2 GB in size, namely hdb1 and hdb2. Save and exit. Use fdisk/dev/hdb to verify the result.
2. the format of the format for formatting The Mkfs command is as follows:-t indicates the type of the specified file system,-V indicates the creation of the output, and is mostly used for testing.-c checks whether there are bad blocks first, then, format it.-j generates the registration report journal for the ext3 system ). Is the process of formatting/dev/hdb1.
3. The E2label command for partitions has two functions: view the tags of partitions and add tags for partitions. For example, e2label/dev/hdb1/home displays the/dev/hdb1 label. To add/dev/hdb1 to/home, use the following command to add labels. E2label/dev/hdb1/home respectively specify the partition labels. E2label/dev/hdb1/homeE2label/dev/hdb2/home/zheng
4. create a mount point and mount the directory Mkdir/home/zheng to create the Mount directory/zheng because the special feature of the directory to be loaded is the main directory of all users except the root user ), therefore, you must back up the file before loading it to the new file system, and restore it to the new file system after loading the directory. Otherwise, Once loaded, the content in the/home directory will become the orphan file directory lost + found ). Therefore, you need to use backup commands, such as tar and cpio.
After creating a mount point, run the tar command to back up and save it to another region: Tar cvzf homebackup.tar.gz/home to load the directory to the file system. Mount/dev/hdb1/home Mount/dev/hdb2/homg/zheng restore the backup to the new file system Tar tkvzf homebackup.tar.gz after the directory is mounted.
5. Modify the fstab file to make the Linux system load the directory during the boot process, we need to modify the/etc/fstab file. In the fstab file, the meaning of each field is as follows: column number field description
1Label file system to be installed such as/usr) or partition such as/dev/sdb1)
2 Mount Point: the directory of the partition or file system to be loaded
3Format File System Format type, such as ext2, ext3, and reiserfs
4 Mount Options default Options include rw read and write), suidSUID permission), dev terminal and Block devices such as the tape drive), extc binary files), auto automatic loading) nouser can be loaded only by the root user) and async data is asynchronously read/written)
5 Dump Value1 indicates that the file system automatically writes data to the disk.
6. Filesystem Check Order requires the fsck file system. The root Linux operating system is 1, other file systems on the local computer are 2, and the swap, virtual, CD, floppy disk, and remote directories are 0.
Therefore, for the mounted directory, add the following content based on the original fstab file:
LABEL =/home ext3 defaults 1 2
LABEL =/home/zheng ext3 defaults 1 2
Save the file and restart the system. As you can see during the startup process, the creation of a new ext3 file system is basically complete. You can run the df command to verify the correctness of the load.
Linux operating system description: The example in reference 1 is to load the/home directory to the ext3 file system, but it does not indicate that the directory needs to be packaged and backed up, after the directory is loaded, only the orphan file directory is generated in the/home directory. In reference 2, it is not pointed out that necessary backup is required for loading directories that already have content.
- Basic concepts of Hard Disk Partitioning in Linux
- Create, compile, and execute a Linux operating system
- The development status and trend of Linux operating system in various fields
- CentOS VM supports RedHat AS3/AS4/AS5Linux Operating System
- Detailed analysis of Linux operating system PS commands