Management of the Linux file system to create file systems and mount the file system processes Detailed

Author: North-South-North
from: League of Legends Community
Abstract: In this paper, the new hard drive, cutting hard disk, create a hard disk partition, creating file systems for hard disk partition, and load the file system processes to make summary discussion; mainly for beginners to figure out this operation; herein relate fdisk, mkfs, mount ... ... and other tools; to / etc / fstab to understand, said; there fsck disk scanning tools such as presentation;


++++++++++++++++++++++++++++++++++++++++++++++++++ ++++
text
+++++++++++++++++++++++++++++++++++++++++++++ +++++++++


Reading this article, you must have knowledge:

"View Linux disk partitions, file systems, command usage and related tools introduced"
"instance commentary fdisk to use"
"rational planning of your hard disk partitions"
"Fedora / Redhat Package Manager Guide "

If you want to load a partition (file system), you have to first make sure the type of file system before you can mount use, such as through the mount load, or to turn on automatically loaded by modifying the / etc / fstab;
if you want to add a new partition, or adding a new hard drive, you want to add a partition by partition tool, and then want to create a partition file system, and only then mount the file system; for example, by mount load, or to turn on by modifying the / etc / fstab automatic loading ;

In this paper there is always a part of what you want; for example, create a file system on a new partition, how to mount; how to unmount the file system or device (such as cdrom) and so on; I built you may want to read this article, then according to their needs do selective practice;

Knowledge of many aspects of Linux a small problem involved, a document is sometimes difficult to make it clear; I for a detailed explanation of each process as much as possible, so the partitioning tool, create a file system tools, see the separate tools for file system, It is designed to allow beginners easier to understand. I hope you can understand my intentions; the legend of the north-south length of relatively ugly, but it's still good heart ... ... I will not harm you to come with some garbage documents ... ... ha ha .... .. Closer to home, Kai-wen ~ ~ ~ ~


A partition of the storage device;

Our storage device referred to here mainly local hard disk, a removable disk (such as a USB interface 1394, and a hard disk); large due to a disk and to meet our needs, so the hard disk into a plurality of partitions; example, we can use this partition to install a Linux system, the partition to install Windows system ... ...; this little thing we all understand;

As for how the hard disk partitioning in Linux, we recommend that you use fdisk, it seems partitioning tools are best used; other tools such as cfdisk and parted a little advantage in one respect, but these advantages may bring some convenience for everyone such as data backup parted in, this feature may be an advantage for veterans, but for the novice, is really risky; so we recommend that you use fdisk partition tool;

fdisk for use: Refer to: "Use Example illustrates fdisk"


Second, the storage format, i.e., the process of a file system;


1 point presentation, file system

We are still far from enough to partition storage devices, we have these new format the partition; after a partition only to establish some kind of file system, in order to use this partition; a file system process, is to use the appropriate formatting tools the process of formatting the partition, this process and we are in Windows format a partition to NTFS partitions similar; no profound content, but not the same tools used by Bale;

In the Linux operating system, currently supports almost mainstream file systems such as NTFS (read-only), FAT (read and write), ext2, ext3, reiserfs, hfs (MAC operating system's file system), swap swap. .. ... there are some we are not familiar with the operating system's file system;

In Linux, we used the file system is nothing more than an example of the above; if you add a hard drive, you may want to format into the Linux file system, the best option is reiserfs or ext3; currently ext2 has been replaced by ext3; we not recommended ext2 filesystem, use ext2 risk is relatively large; the fastest file system, comes as reiserfs; reiserfs there are many advantages, such as more secure; ext3 is Redhat think the best file system, so Fedora 4.0 in when installed, specially selected reiserfs come up to the point of trouble;

Relatively speaking, reiserfs still be better than ext3; if you want in-depth study of the file system, you can find the appropriate forum to official data, the best practice is practice;

2, introduction and use formatting tools;

With fedora 4.0, for example, we used the tool mkfs mkfs.ext3 mkfs.reiserfs mkfs.ext2 mkfs.msdos mkfs.vfat mkswap

Tip: If you can not create reiserfs file system, which means that no mkfs.reiserfs or mkreiserfs command, you do not install the reiserfs-utils Kit, please refer to: "Let supports the creation of Fedora reiserfs file system, and create reiserfs file system that Description "


1) Use of mkfs;

Instructions:

[root@localhost beinan]# mkfs -t 文件系统  存储设备



NOTE:
this file system is to be specified, such as ext3; reiserfs; ext2; fat32; msdos etc ...
device, such as a hard disk partition, floppy disks, optical drives and the like .. ...

Before formatting the partition, you have to know how to view the hard disk partition, and targeted format; such as using fdisk -l to see;

Please refer to: "View Linux disk partitions, file systems, command usage and related tools introduced"

For example, I want to format a partition U disk mobile; panorama should be:

[root@localhost beinan]# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         765     6144831    7  HPFS/NTFS
/dev/hda2             766        2805    16386300    c  W95 FAT32 (LBA)
/dev/hda3            2806        9729    55617030    5  Extended
/dev/hda5            2806        3825     8193118+  83  Linux
/dev/hda6            3826        5100    10241406   83  Linux
/dev/hda7            5101        5198      787153+  82  Linux swap / Solaris
/dev/hda8            5199        6657    11719386   83  Linux
/dev/hda9            6658        7751     8787523+  83  Linux
/dev/hda10           7752        9729    15888253+  83  Linux

Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          25      201568+  83  Linux
/dev/sda2              26         125      806400    5  Extended
/dev/sda5              26          50      201568+  83  Linux
/dev/sda6              51          76      200781     83  Linux

We can see that there sda ​​this device, so you can use fdisk -l / dev / sda partition specifically to show his circumstances; for example, I want to format / dev / sda6 partition to ext3 file system, then:

[root@localhost beinan]# mkfs -t ext3  /dev/sda6
mke2fs 1.37 (21-Mar-2005)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
50200 inodes, 200780 blocks
10039 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
25 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information:  注:在这里直接回车;
done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

This format Well, sda6 now is the ext3 file system; we can load the partition with a mount, and then use the file system;

[root@localhost beinan]# mkdir /mnt/sda6
[root@localhost beinan]# chmod 777 /mnt/sda6
[root@localhost beinan]# mount /dev/sda6   /mnt/sda6

Of course, you can also partition formatted to other file systems; for example, we put / dev / sda6 formatted as ext3, ext2, reiserfs, fat32, msdos file system, the command format is as follows;

[root@localhost beinan]# mkfs -t ext3  /dev/sda6
[root@localhost beinan]# mkfs -t ext2  /dev/sda6
[root@localhost beinan]# mkfs -t reiserfs  /dev/sda6
[root@localhost beinan]# mkfs -t fat32   /dev/sda6
[root@localhost beinan]# mkfs -t msdos   /dev/sda6
... ...


2)mkfs.ext3 mkfs.reiserfs mkfs.ext2 mkfs.msdos mkfs.vfat mke2fs 的介绍;

We start with a mkfs tools, let us introduce mkfs.ext3 mkfs.reiserfs mkfs.ext2 mkdosfs mkfs.msdos mkfs.vfat, this tool is actually in the mkfs command to be executed when is called, this is my first mkfs the main reason introduced;

By file name, we know what these tools are file system support; these commands provide more convenient for us;


[root@localhost beinan]# mkfs.ext3    /dev/sda6     注:把该设备格式化成ext3文件系统
[root@localhost beinan]# mke2fs -j   /dev/sda6       注:把该设备格式化成ext3文件系统
[root@localhost beinan]# mkfs.ext2  /dev/sda6       注:把该设备格式化成ext2文件系统
root@localhost beinan]# mke2fs    /dev/sda6          注:把该设备格式化成ext2文件系统
[root@localhost beinan]# mkfs.reiserfs  /dev/sda6   注:把该设备格式化成reiserfs文件系统
[root@localhost beinan]# mkfs.vfat   /dev/sda6        注:把该设备格式化成fat32文件系统
[root@localhost beinan]# mkfs.msdos   /dev/sda6   注:把该设备格式化成fat16文件系统,msdos文件系统就是fat16;
[root@localhost beinan]# mkdosfs   /dev/sda6         注:把该设备格式化成fat16文件系统,同mkfs.msdos
... ...



2) mkswap to become a swap partition formatted exchange area;

[root@localhost beinan]# mkswap /dev/sda6  注:创建此分区为swap 交换分区
[root@localhost beinan]# swapon  /dev/sda6  注:加载交换分区;
[root@localhost beinan]# swapoff  /dev/sda6  注:关闭交换分区;

We view the system already loaded swap swap partition;

[root@localhost beinan]# swapon  /dev/sda6  注:加载交换分区;
[root@localhost beinan]# swapon -s               
Filename                                Type            Size    Used    Priority
/dev/hda7                               partition       787144  0       -1
/dev/sda6                               partition       225144  0       -3
<code>

为什么我的系统有两个交换分区?因为我用移动U盘做的实验,主要是为写教程之用;sda6是我在U盘上建的swap分区;

如果让swap开机就加载,应该改 /etc/fstab文件,加类似如下一行;

<code>
/dev/sda6         swap                    swap    defaults        0 0  注:把此行中的/dev/hda7 改为您的交换分区就行;

Or the command line is also directly written /etc/rc.d/rc.local;

swapon  /dev/sda6 

If your hard disk can not be partitioned, you can create a swap file

[root@localhost beinan]# dd if=/dev/zero of=/tmp/swap bs=1024 count=524288 注:创建一个大小为512M 的swap 文件,在/tmp目录中;您可以根据自己的需要的大小来创建swap 文件;

读入了 524288+0 个块
输出了 524288+0 个块
[root@localhost beinan]# mkswap /tmp/swap 注:把/tmp/swap 文件,创建成swap 交换区
Setting up swapspace version 1, size = 536866 kB
no label, UUID=d9d8645d-92cb-4d33-b36e-075bb0a2e278
[root@localhost beinan]# swapon /tmp/swap   注:挂载swap

[root@localhost beinan]# swapon -s
Filename Type Size Used Priority
/dev/hda7 partition 787144 888 -1
/tmp/swap file 524280 0 -2

Note: In fact, when we installed the system, has divided the swap partition; see the / etc / fstab, should swap lines; did not add swap If you install the system, can be added by this approach;


Third, mount the file system;

Mount the file system, there are two ways, one is to mount by mount, another method is to boot automatically mount via / etc / fstab file;


1, through the mount to mount the disk partition (or storage device)

mount the usage of simple fact, we say a few common;

mount the file system command format:

[root@localhost beinan]# mount  [-t  文件系统 ]  [-o  选项]  设备  目录

Note:

-t With this parameter, we specify the type of file system, under normal circumstances without specifying sometimes can increase knowledge, followed with -t ext3, ext2, reiserfs, vfat, ntfs etc., in which vfat is fat32 and fat16 partition file system the parameters used; if you forget your file system, you can also add auto behind -t;

-o this option, the main options are permissions, users, disk quotas, and other coding language, but the language encoding options, mostly for vfat and ntfs file system; because of too many options, or refer you to the man mount; not much here Say;

Equipment refers to a storage device, such as / dev / hda1, / dev / sda1, cdrom etc ... As for your system which storage devices have, mainly through fdisk -l or view the / etc / fstab or dmesg; under normal circumstances drive device is / dev / cdrom; floppy disk device is / dev / fd0; hard disks and removable hard disk to output fdisk -l prevail;


1) mounted on the drive and floppy disk drive;


Example:

[root@localhost beinan]# mount /dev/cdrom
[root@localhost beinan]# mount /dev/fd0

The first line is the mount CD-ROM, as the mount where we can view the / etc / fstab to see; Similarly floppy / dev / fd0 device, too; for example, we in / etc / fstab

/dev/hdc                /media/cdrecorder       auto    users,exec,noauto,managed 0 0

We can be sure that the disc is to mount the / media / cdrecorder directory;

But we also can own to specify cdrom mount location; for example, / mnt / cdrom, so we can do to mount the CD-ROM drive;

[root@localhost beinan]#mkdir /mnt/cdrom
[root@localhost beinan]# mount /dev/cdrom  /mnt/cdrom

Let's create a directory and then execute the mount command, which hung in cdrom / mnt / cdrom in the; we can view the disc information and documents in / mnt / cdrom in; how this directory you want to build on how to build. What directory is not the most important. It is important that you know what you're doing on the line. For example, we can put this directory built dvdrom; then mount / dev / cdrom / mnt / dvdrom to mount;

Sometimes our equipment is COMBO, there is also support support dvd cd burning; we'd better check the CD-ROM device, there are two ways, first by looking at the / etc / fstab, the second is to see through ls -l ; for example, we look similar to the following line in / etc / fstab in;

/dev/hdc                /media/cdrecorder       auto    users,exec,noauto,managed 0 0

Through this, we can know hdc is also cdrom dvdrom equipment, but cdrecorder equipment; To validate our statement; please use ls -l to list of files;

[root@localhost beinan]# ls -lh /dev/dvd*
lrwxrwxrwx  1 root root 3 2005-09-13  /dev/dvd -> hdc
[root@localhost beinan]# ls -lh /dev/cdrom
lrwxrwxrwx  1 root root 3 2005-09-13  /dev/cdrom -> hdc
[root@localhost beinan]# ls -lh /dev/cdwriter
lrwxrwxrwx  1 root root 3 2005-09-13  /dev/cdwriter -> hdc

It is not clear yet? dvd, cdrom, cdwriter file names are linked to the hdc this equipment, so the root of the drive device is / dev / hdc; so we can mount this CD-ROM;

[root@localhost beinan]# mkdir /mnt/cdrom
[root@localhost beinan]# mount  /dev/hdc   /mnt/cdrom




2) Mount hard disks and removable hard disk file system;

Only one partition can be created using the file system, as we said, we mostly use in Linux are ext2, ext3, reiserfs, fat32, msdos, ntfs etc.;

[1] Linux file system mount;

For ext2, ext3, reiserfs do not need to specify the encoding of the file system, in fact, did not mount this function; these Linux file system, if the coding problem, usually specified by export LANG; so, to mount file systems is relatively simple;

First we have to build a file system mounted directory; we have already mentioned; a partition file system to be linked to the system, there must be a mount point; this mount point is a directory; for example, we pass fdisk -l know hda5 is the Linux partitions, and create a file system, such as it is reiserfs file system;

[root@localhost beinan]# fdisk -l /dev/hda

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         765     6144831    7  HPFS/NTFS
/dev/hda2             766        2805    16386300    c  W95 FAT32 (LBA)
/dev/hda3            2806        9729    55617030    5  Extended
/dev/hda5            2806        3825     8193118+  83  Linux
/dev/hda6            3826        5100    10241406   83  Linux
/dev/hda7            5101        5198      787153+  82  Linux swap / Solaris
/dev/hda8            5199        6657    11719386   83  Linux
/dev/hda9            6658        7751     8787523+  83  Linux
/dev/hda10           7752        9729    15888253+  83  Linux

We first use fdisk -l to see what partition situation: we want to mount / dev / hda5 partition, such as hda5 partition is created reiserfs file system;

[root@localhost beinan]# mkdir /mnt/hda5/   注:先创建一个挂载目录;
[root@localhost beinan]# chmod 777  /mnt/hda5/    注:设置/mnt/hda5的权限为任何用户可写可读可执行;这样所有的用户都能在写入;
[root@localhost beinan]# mount -t reiserfs /dev/hda5 /mnt/hda5    注:通过-t reiserfs 来指定/dev/hda5是reiserfs 文件系统, 并且挂载到/mnt/hda5目录;
[root@localhost beinan]# mount  -t auto   /dev/hda5 /mnt/hda5   注:假如我们不知道hda5上reiserfs 文件系统,我们可以用 -t auto 让系统定夺,然后挂载到/mnt/hda5 ;
[root@localhost beinan]# mount /dev/hda5 /mnt/hda5   注:不加任何参数,直接 mount   /dev/hda5 到/mnt/hda5;系统自动判断分区文件系统;

It is not to be mounted, and we see by df -lh;

[root@localhost beinan]# df -lh
Filesystem            容量  已用 可用 已用% 挂载点
/dev/hda8              11G  8.5G  1.9G  83% /
/dev/shm              236M     0  236M   0% /dev/shm
/dev/hda10             16G  6.9G  8.3G  46% /mnt/hda10
/dev/hda5             7.9G  5.8G  2.1G  74% /mnt/hda5




[2] mount a Windows file system;

Refer to: "In Fedora core 4.0 NTFS and FAT32 partition to load detailed"


3) unmount the file system umount;


command usage:

[root@localhost beinan]# umount  设备或挂载目录


For example:

[root@localhost beinan]# mount -t auto /dev/hda5 /mnt/hda5   注:挂载/dev/hda5;

[root@localhost beinan]# df -lh       注:查看/dev/hda5是否被挂载;
Filesystem            容量  已用 可用 已用% 挂载点
/dev/hda8              11G  8.5G  1.9G  83% /
/dev/shm              236M     0  236M   0% /dev/shm
/dev/hda10             16G  6.9G  8.3G  46% /mnt/hda10
/dev/hda5             7.9G  5.8G  2.1G  74% /mnt/hda5

[root@localhost beinan]# umount /dev/hda5  注:卸载/dev/hda5

[root@localhost beinan]# df -lh        注:看是否卸载了/dev/hda5;
Filesystem            容量  已用 可用 已用% 挂载点
/dev/hda8              11G  8.5G  1.9G  83% /
/dev/shm              236M     0  236M   0% /dev/shm
/dev/hda10             16G  6.9G  8.3G  46% /mnt/hda10

[root@localhost beinan]#umount /dev/cdrom  注:卸载cdrom ;
[root@localhost beinan]#umount  /dev/fd0   注:卸载软驱;

... ...

Besides a partition is mounted to see if the command directly mount -s

[root@localhost beinan]# mount -s


2, the / etc / fstab file to automatically mount the file system boot


1) understood fstab

Above we said storage device file system mount Mounts way; now let's talk about the / etc / boot way to automatically mount fstab file system implemented; we need to see / etc / fstab; mainly to see his plan writing;

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1                /                       ext3    defaults        1 1
/dev/devpts             /dev/pts                devpts  gid=5,mode=620  0 0
/dev/shm                /dev/shm                tmpfs   defaults        0 0
/dev/proc               /proc                   proc    defaults        0 0
/dev/sys                /sys                    sysfs   defaults        0 0
LABEL=SWAP-hda7         swap                    swap    defaults        0 0
/dev/hdc                /media/cdrecorder       auto    users,exec,noauto,managed 0 0

The first field: the device name, the file system is represented here; we mount the file system may be mounted to said partition; in this field can also be used partition label; / LABEL = / 1 system is installed in the examples Fedora partition labels, as to which partition you can use df -lh to see;

[root@localhost beinan]# df -lh
Filesystem            容量  已用 可用 已用% 挂载点
/dev/hda8              11G  8.5G  1.9G  83% /
/dev/shm              236M     0  236M   0% /dev/shm
/dev/hda10             16G  6.9G  8.3G  46% /mnt/hda10

We can know LABEL = / 1 is / dev / hda8 label; then we use what command to create a hard disk partition label it?

For ext2 and ext3 file system, we can use to set e2label

e2label device [newlabel]

For example, we want to label equipment ext3 file system partition / dev / hda5 to / 5, we should execute the following command:

[root@localhost beinan]# e2label /dev/hda5  /5  
[root@localhost beinan]# mkdir /mnt/hda5  注:创建挂载/dev/hda5分区的目录;
[root@localhost beinan]# chmod 777 /mnt/hda5  注:打开权限,所有用户可读可写可执行;

Then we have to change / etc / fstab add a line

/5         /mnt/hda5                    ext3     defaults        0 0

Warning: Do not install your Linux partition (ie partition Linux system / where) practice, will cause your system to crash Linux; if you want to practice, on the other partition test;

If reiserfs file system, we should use

[Root @ localhost beinan] # reiserfstune -l label equipment

Example: I is reiserfs for example, / dev / hda10 label set / 10;

[root@localhost beinan]# reiserfstune -l /10 /dev/hda10

We add a line in / etc / fstab in;

/10              /mnt/hda10              reiserfs defaults       0 0

Warning: Do not install your Linux partition (ie partition Linux system / where) practice, will cause your system to crash Linux; if you want to practice, on the other partition test;

The second field: the mount point of the file system;
third field: the file system type;
fourth field: the option of the mount command, and the mount -o empathy; Defaults include the options rw, suid, dev, exec, auto , nouser, async; through practice, this default can meet our needs; as to the meaning of these options, see man mount;

The fifth field: Indicates whether the file system needs to dump backup, is the relationship between true and false; 1 is required, 0 is not required;
a sixth field: whether at system startup, by fsck to check the file system disk detection tool 1 is required, 0 is not required, skip 2;

Based on these findings; for example, we want to boot automatically mount / dev / hda5; we can do as follows;

[root@localhost beinan]# mkdir /mnt/hda5/   注:先创建一个挂载目录;
[root@localhost beinan]# chmod 777  /mnt/hda5/    注:设置/mnt/hda5的权限为任何用户可写可读可执行;这样所有的用户都能在写入;

We then the following line in / etc / fstab and Canada;

/dev/hda5              /mnt/hda5             reiserfs defaults       0 0

Such restart the machine will be able to see the effect;


Fourth, the file system scan fsck;

We do not lonely to live it with scandisk in Windows, in Linux there are similar tools such as fsck, fsck but not just scanning, but also to fix some problems file system. It is noteworthy that must be carried out after the single-user mode, repair mode or when the device umount fsck scans the file system.

Warning: If the system scan is running, it will cause system file corruption; if your system is normal, please do not use a scan tool, she probably will get your system broken, fsck run is dangerous;

With Fedora, for example, the file system scanning tools fsck fsck.ext2 fsck.jfs fsck.msdos fsck.vfat fsck.ext3 fsck.reiserfs (reiserfsck)

Fsck default file system which supports ext2, ext3 if you want to support scanning the file system, you should add -j parameter, it is best that we should be called different scanning tool based on different file systems, such as fsck.ext2, fsck.jfs, fsck .msdos, fsck.ext3, fsck.reiserfs (reiserfsck) and so on. We can also choose different scan tools according to their own file system;

Example: Scan / dev / hda10 partition (reiserfs based file system);

[root@localhost beinan]# fsck.reiserfs /dev/hda10
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to [email protected], **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will read-only check consistency of the filesystem on /dev/hda10
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
###########
reiserfsck --check started at Wed Sep 14 08:54:17 2005
###########
Replaying journal..
Reiserfs journal '/dev/hda10' in blocks [18..8211]: 0 transactions replayed
Checking internal tree..finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found   注:没有发现错误;
There are on the filesystem:
        Leaves 2046
        Internal nodes 15
        Directories 130
        Other files 2305
        Data block pointers 1863657 (70565 of them are zero)
        Safe links 0
###########
reiserfsck finished at Wed Sep 14 08:54:33 2005
###########

For fsck.ext2 and fsck.ext3 common options:

-p         Automatic repair (no questions) 注:自动修复文件系统存在的问题;
-y         Assume "yes" to all questions   注:如果文件系统有问题,会跳出提示是否修复,如果修复请按y;
-c         Check for bad blocks and add them to the badblock list 注:对文件系统进行坏块检查;这是一个极为漫长的过程;
-n         Make no changes to the filesystem   注:不对文件系统做任何改变,只要扫描,以检测是否有问题;

Example: For example, / dev / hda6 (the ext3 file system is), I would like to automatically scan and repair;

[root@localhost beinan]# fsck.ext3  -p /dev/hda6

Note: for different file systems, preferably with the corresponding tool; fsck although sometimes without additional parameters can recognize different file system;

For the most detailed parameters of the different tools, see --help or man, thank you. .


postscript:

Create a file system and file system load even write about it; and then may not be profound I can write. To mount a file system write system, I have written several documents. You may have the need to add a few short document, and there is a summary of the document;

For example, the default installation of Fedora Core 4.0 does not support creating reiserfs file system, the solution is to install the reiserfs-utils, which is the need to add;


appendix:

"Linux view disk partitions, file systems, the use of commands and tools introduced"
"instance commentary fdisk to use"
"detailed in Fedora core 4.0 is loaded NTFS and FAT32 partition"
"rational planning of your hard disk partitions"
"system boot and hard disk partition structures are discussed in "
" Fedora Core 4.0 HAL configured plug and play removable storage (USB and 1394) in practice. "

Reproduced in: https: //www.cnblogs.com/licheng/archive/2008/01/21/1047285.html

Guess you like

Origin blog.csdn.net/weixin_34337381/article/details/92630498