Linux 磁盘管理65u
Linux 磁盘管理
Linux 磁盘管理好坏直接关系到整个系统的性能问题。
Linux 磁盘管理常用三个命令为 df、du 和 fdisk。
- df(英文全称:disk free):列出文件系统的整体磁盘使用量
- du(英文全称:disk used):检查磁盘空间使用量
- fdisk:用于磁盘分区
df
df命令参数功能:检查文件系统的磁盘空间占用情况。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。
语法:
df [-ahikHTm] [目录或文件名]
选项与参数:
-
-h:以人类可读的方式显示输出结果(例如,使用 KB、MB、GB 等单位)。 -
-T:显示文件系统的类型。 -
-t <文件系统类型>:只显示指定类型的文件系统。 -
-i:显示 inode 使用情况。 -
-H:该参数是-h的变体,但是使用 1000 字节作为基本单位而不是 1024 字节。这意味着它会以 SI(国际单位制)单位(例如 MB、GB)而不是二进制单位(例如 MiB、GiB)来显示磁盘使用情况。 -
-k:这个选项会以 KB 作为单位显示磁盘空间使用情况。 -
-a:该参数将显示所有的文件系统,包括虚拟文件系统,例如proc、sysfs等。如果没有使用该选项,默认情况下,df命令不会显示虚拟文件系统。
实例 1
将系统内所有的文件系统列出来!
[root@www ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hdc2 9920624 3823112 5585444 41% / /dev/hdc3 4956316 141376 4559108 4% /home /dev/hdc1 101086 11126 84741 12% /boot tmpfs 371332 0 371332 0% /dev/shm
在 Linux 底下如果 df 没有加任何选项,那么默认会将系统内所有的 (不含特殊内存内的文件系统与 swap) 都以 1 Kbytes 的容量来列出来!
实例 2
将容量结果以易读的容量格式显示出来
[root@www ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/hdc2 9.5G 3.7G 5.4G 41% / /dev/hdc3 4.8G 139M 4.4G 4% /home /dev/hdc1 99M 11M 83M 12% /boot tmpfs 363M 0 363M 0% /dev/shm
实例 3
将系统内的所有特殊文件格式及名称都列出来
[root@www ~]# df -aT Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/hdc2 ext3 9920624 3823112 5585444 41% / proc proc 0 0 0 - /proc sysfs sysfs 0 0 0 - /sys devpts devpts 0 0 0 - /dev/pts /dev/hdc3 ext3 4956316 141376 4559108 4% /home /dev/hdc1 ext3 101086 11126 84741 12% /boot tmpfs tmpfs 371332 0 371332 0% /dev/shm none binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc sunrpc rpc_pipefs 0 0 0 - /var/lib/nfs/rpc_pipefs
实例 4
将 /etc 底下的可用的磁盘容量以易读的容量格式显示
[root@www ~]# df -h /etc Filesystem Size Used Avail Use% Mounted on /dev/hdc2 9.5G 3.7G 5.4G 41% /
du
Linux du 命令也是查看使用空间的,但是与 df 命令不同的是 Linux du 命令是对文件和目录磁盘使用的空间的查看,还是和df命令有一些区别的,这里介绍 Linux du 命令。
语法:
du [-ahskm] 文件或目录名称
选项与参数:
- -a :列出所有的文件与目录容量,因为默认仅统计目录底下的文件量而已。
- -h :以人们较易读的容量格式 (G/M) 显示;
- -s :仅显示指定目录或文件的总大小,而不显示其子目录的大小。
- -S :包括子目录下的总计,与 -s 有点差别。
- -k :以 KBytes 列出容量显示;
- -m :以 MBytes 列出容量显示;
实例 1
只列出当前目录下的所有文件夹容量(包括隐藏文件夹):
[root@www ~]# du 8 ./test4 <==每个目录都会列出来 8 ./test2 ....中间省略.... 12 ./.gconfd <==包括隐藏文件的目录 220 . <==这个目录(.)所占用的总量
直接输入 du 没有加任何选项时,则 du 会分析当前所在目录里的子目录所占用的硬盘空间。
实例 2
将文件的容量也列出来
[root@www ~]# du -a 12 ./install.log.syslog <==有文件的列表了 8 ./.bash_logout 8 ./test4 8 ./test2 ....中间省略.... 12 ./.gconfd 220 .
实例 3
检查根目录底下每个目录所占用的容量
[root@www ~]# du -sm /* 7 /bin 6 /boot .....中间省略.... 0 /proc .....中间省略.... 1 /tmp 3859 /usr <==系统初期最大就是他了啦! 77 /var
通配符 * 来代表每个目录。
与 df 不一样的是,du 这个命令其实会直接到文件系统内去搜寻所有的文件数据。
fdisk
fdisk 是 Linux 的磁盘分区表操作工具。
语法:
fdisk [-l] 装置名称
选项与参数:
- -l :输出后面接的装置所有的分区内容。若仅有 fdisk -l 时, 则系统将会把整个系统内能够搜寻到的装置的分区均列出来。
实例 1
列出所有分区信息
[root@AY120919111755c246621 tmp]# fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 2550 20480000 83 Linux
/dev/xvda2 2550 2611 490496 82 Linux swap / Solaris
Disk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x56f40944
Device Boot Start End Blocks Id System
/dev/xvdb2 1 2610 20964793+ 83 Linux
实例 2
找出你系统中的根目录所在磁盘,并查阅该硬盘内的相关信息
[root@www ~]# df / <==注意:重点在找出磁盘文件名而已 Filesystem 1K-blocks Used Available Use% Mounted on /dev/hdc2 9920624 3823168 5585388 41% / [root@www ~]# fdisk /dev/hdc <==仔细看,不要加上数字喔! The number of cylinders for this disk is set to 5005. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): <==等待你的输入!
输入 m 后,就会看到底下这些命令介绍
Command (m for help): m <== 输入 m 后,就会看到底下这些命令介绍 Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition <==删除一个partition l list known partition types m print this menu n add a new partition <==新增一个partition o create a new empty DOS partition table p print the partition table <==在屏幕上显示分割表 q quit without saving changes <==不储存离开fdisk程序 s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit <==将刚刚的动作写入分割表 x extra functionality (experts only)
离开 fdisk 时按下 q,那么所有的动作都不会生效!相反的, 按下w就是动作生效的意思。
Command (m for help): p <== 这里可以输出目前磁盘的状态 Disk /dev/hdc: 41.1 GB, 41174138880 bytes <==这个磁盘的文件名与容量 255 heads, 63 sectors/track, 5005 cylinders <==磁头、扇区与磁柱大小 Units = cylinders of 16065 * 512 = 8225280 bytes <==每个磁柱的大小 Device Boot Start End Blocks Id System /dev/hdc1 * 1 13 104391 83 Linux /dev/hdc2 14 1288 10241437+ 83 Linux /dev/hdc3 1289 1925 5116702+ 83 Linux /dev/hdc4 1926 5005 24740100 5 Extended /dev/hdc5 1926 2052 1020096 82 Linux swap / Solaris # 装置文件名 启动区否 开始磁柱 结束磁柱 1K大小容量 磁盘分区槽内的系统 Command (m for help): q
想要不储存离开吗?按下 q 就对了!不要随便按 w 啊!
使用 p 可以列出目前这颗磁盘的分割表信息,这个信息的上半部在显示整体磁盘的状态。
磁盘格式化
磁盘分割完毕后自然就是要进行文件系统的格式化,格式化的命令非常的简单,使用 mkfs(make filesystem) 命令。
语法:
mkfs [-t 文件系统格式] 装置文件名
选项与参数:
- -t :可以接文件系统格式,例如 ext3, ext2, vfat 等(系统有支持才会生效)
实例 1
查看 mkfs 支持的文件格式
https://avg.163.com/topic/detail/10345425
https://avg.163.com/topic/detail/10345495
https://avg.163.com/topic/detail/10345494
https://avg.163.com/topic/detail/10345488
https://avg.163.com/topic/detail/10345490
https://avg.163.com/topic/detail/10345493
https://avg.163.com/topic/detail/10345492
https://avg.163.com/topic/detail/10345491
https://avg.163.com/topic/detail/10345408
https://avg.163.com/topic/detail/10345489
https://avg.163.com/topic/detail/10345432
https://avg.163.com/topic/detail/10345485
https://avg.163.com/topic/detail/10345487
https://avg.163.com/topic/detail/10345486
https://avg.163.com/topic/detail/10345484
https://avg.163.com/topic/detail/10345407
https://avg.163.com/topic/detail/10345483
https://avg.163.com/topic/detail/10345482
https://avg.163.com/topic/detail/10345481
https://avg.163.com/topic/detail/10345480
https://avg.163.com/topic/detail/10345478
https://avg.163.com/topic/detail/10345477
https://avg.163.com/topic/detail/10345476
https://avg.163.com/topic/detail/10345474
https://avg.163.com/topic/detail/10345473
https://avg.163.com/topic/detail/10345472
https://avg.163.com/topic/detail/10345471
https://avg.163.com/topic/detail/10345470
https://avg.163.com/topic/detail/10345468
https://avg.163.com/topic/detail/10345467
https://avg.163.com/topic/detail/10345466
https://avg.163.com/topic/detail/10345464
https://avg.163.com/topic/detail/10345465
https://avg.163.com/topic/detail/10345461
https://avg.163.com/topic/detail/10345459
https://avg.163.com/topic/detail/10345462
https://avg.163.com/topic/detail/10345463
https://avg.163.com/topic/detail/10345460
https://avg.163.com/topic/detail/10345456
https://avg.163.com/topic/detail/10345457
https://avg.163.com/topic/detail/10345458
https://avg.163.com/topic/detail/10345455
https://avg.163.com/topic/detail/10345385
https://avg.163.com/topic/detail/10345453
https://avg.163.com/topic/detail/10345454
https://avg.163.com/topic/detail/10345452
https://avg.163.com/topic/detail/10345394
https://avg.163.com/topic/detail/10345450
https://avg.163.com/topic/detail/10345451
https://avg.163.com/topic/detail/10345449
https://avg.163.com/topic/detail/10345448
https://avg.163.com/topic/detail/10345358
https://avg.163.com/topic/detail/10345446
https://avg.163.com/topic/detail/10345445
https://avg.163.com/topic/detail/10345444
https://avg.163.com/topic/detail/10345442
https://avg.163.com/topic/detail/10345443
https://avg.163.com/topic/detail/10345441
https://avg.163.com/topic/detail/10345440
https://avg.163.com/topic/detail/10345308
https://avg.163.com/topic/detail/10345439
https://avg.163.com/topic/detail/10345438
https://avg.163.com/topic/detail/10345386
https://avg.163.com/topic/detail/10345436
https://avg.163.com/topic/detail/10345435
https://avg.163.com/topic/detail/10345424
https://avg.163.com/topic/detail/10345434
https://avg.163.com/topic/detail/10345433
https://avg.163.com/topic/detail/10345432
https://avg.163.com/topic/detail/10345430
https://avg.163.com/topic/detail/10345429
https://avg.163.com/topic/detail/10345428
https://avg.163.com/topic/detail/10345312
https://avg.163.com/topic/detail/10345427
https://avg.163.com/topic/detail/10345426
https://avg.163.com/topic/detail/10345425
https://avg.163.com/topic/detail/10345424
https://avg.163.com/topic/detail/10345423
https://avg.163.com/topic/detail/10345370
https://avg.163.com/topic/detail/10345372
https://avg.163.com/topic/detail/10345420
https://avg.163.com/topic/detail/10345154
https://avg.163.com/topic/detail/10345419
https://avg.163.com/topic/detail/10345414
https://avg.163.com/topic/detail/10345417
https://avg.163.com/topic/detail/10345418
https://avg.163.com/topic/detail/10345416
https://avg.163.com/topic/detail/10345413
https://avg.163.com/topic/detail/10345411
https://avg.163.com/topic/detail/10345412
https://avg.163.com/topic/detail/10345409
https://avg.163.com/topic/detail/10345137
https://avg.163.com/topic/detail/10345408
https://avg.163.com/topic/detail/10345407
https://avg.163.com/topic/detail/10345406
https://avg.163.com/topic/detail/10345405
https://avg.163.com/topic/detail/10345404
https://avg.163.com/topic/detail/10345400
https://avg.163.com/topic/detail/10345401
https://avg.163.com/topic/detail/10345399
https://avg.163.com/topic/detail/10345398
https://avg.163.com/topic/detail/10345397
https://avg.163.com/topic/detail/10345363
https://avg.163.com/topic/detail/10345396
https://avg.163.com/topic/detail/10345389
https://avg.163.com/topic/detail/10345303
https://avg.163.com/topic/detail/10345395
https://avg.163.com/topic/detail/10345394
https://avg.163.com/topic/detail/10345393
https://avg.163.com/topic/detail/10345392
https://avg.163.com/topic/detail/10345391
https://avg.163.com/topic/detail/10345390
https://avg.163.com/topic/detail/10345388
https://avg.163.com/topic/detail/10345387
https://avg.163.com/topic/detail/10345252
https://avg.163.com/topic/detail/10345386
https://avg.163.com/topic/detail/10345385
https://avg.163.com/topic/detail/10345384
https://avg.163.com/topic/detail/10345383
https://avg.163.com/topic/detail/10345382
https://avg.163.com/topic/detail/10345381
https://avg.163.com/topic/detail/10345380
https://avg.163.com/topic/detail/10345307
https://avg.163.com/topic/detail/10345378
https://avg.163.com/topic/detail/10345377
https://avg.163.com/topic/detail/10345376
https://avg.163.com/topic/detail/10345375
https://avg.163.com/topic/detail/10345373
https://avg.163.com/topic/detail/10345374
https://avg.163.com/topic/detail/10345372
https://avg.163.com/topic/detail/10345371
https://avg.163.com/topic/detail/10345370
https://avg.163.com/topic/detail/10345369
https://avg.163.com/topic/detail/10345368
https://avg.163.com/topic/detail/10345367
https://avg.163.com/topic/detail/10345366
https://avg.163.com/topic/detail/10345365
https://avg.163.com/topic/detail/10345137
https://avg.163.com/topic/detail/10345364
https://avg.163.com/topic/detail/10345154
https://avg.163.com/topic/detail/10345363
https://avg.163.com/topic/detail/10345361
https://avg.163.com/topic/detail/10345360
https://avg.163.com/topic/detail/10345103
https://avg.163.com/topic/detail/10345358
https://avg.163.com/topic/detail/10345359
https://avg.163.com/topic/detail/10345357
https://avg.163.com/topic/detail/10345356
https://avg.163.com/topic/detail/10345355
https://avg.163.com/topic/detail/10345354
https://avg.163.com/topic/detail/10345353
https://avg.163.com/topic/detail/10345351
https://avg.163.com/topic/detail/10345350
https://avg.163.com/topic/detail/10345103
https://avg.163.com/topic/detail/10345349
https://avg.163.com/topic/detail/10345184
https://avg.163.com/topic/detail/10345347
https://avg.163.com/topic/detail/10345348
https://avg.163.com/topic/detail/10345345
https://avg.163.com/topic/detail/10345343
https://avg.163.com/topic/detail/10345340
https://avg.163.com/topic/detail/10345339
https://avg.163.com/topic/detail/10345334
https://avg.163.com/topic/detail/10345330
https://avg.163.com/topic/detail/10345328
https://avg.163.com/topic/detail/10345320
https://avg.163.com/topic/detail/10345312
https://avg.163.com/topic/detail/10345311
https://avg.163.com/topic/detail/10345310
https://avg.163.com/topic/detail/10345309
https://avg.163.com/topic/detail/10345308
https://avg.163.com/topic/detail/10345307
https://avg.163.com/topic/detail/10345306
https://avg.163.com/topic/detail/10345305
https://avg.163.com/topic/detail/10345304
https://avg.163.com/topic/detail/10345303
https://avg.163.com/topic/detail/10345302
https://avg.163.com/topic/detail/10345226
https://avg.163.com/topic/detail/10345087
https://avg.163.com/topic/detail/10345294
https://avg.163.com/topic/detail/10345292
https://avg.163.com/topic/detail/10345284
https://avg.163.com/topic/detail/10345272
https://avg.163.com/topic/detail/10345276
https://avg.163.com/topic/detail/10345270
https://avg.163.com/topic/detail/10345269
https://avg.163.com/topic/detail/10345268
https://avg.163.com/topic/detail/10345217
https://avg.163.com/topic/detail/10345266
https://avg.163.com/topic/detail/10345265
https://avg.163.com/topic/detail/10345263
https://avg.163.com/topic/detail/10345159
https://avg.163.com/topic/detail/10345262
https://avg.163.com/topic/detail/10345261
https://avg.163.com/topic/detail/10345252
https://avg.163.com/topic/detail/10345249
https://avg.163.com/topic/detail/10345250
https://avg.163.com/topic/detail/10345088
https://avg.163.com/topic/detail/10345246
https://avg.163.com/topic/detail/10345239
https://avg.163.com/topic/detail/10345091
https://avg.163.com/topic/detail/10345236
https://avg.163.com/topic/detail/10345115
https://avg.163.com/topic/detail/10345103
https://avg.163.com/topic/detail/10345137
https://avg.163.com/topic/detail/10345227
https://avg.163.com/topic/detail/10345121
https://avg.163.com/topic/detail/10345226
https://avg.163.com/topic/detail/10345224
https://avg.163.com/topic/detail/10345225
https://avg.163.com/topic/detail/10345222
https://avg.163.com/topic/detail/10345221
https://avg.163.com/topic/detail/10345220
https://avg.163.com/topic/detail/10345219
https://avg.163.com/topic/detail/10345218
https://avg.163.com/topic/detail/10345217
https://avg.163.com/topic/detail/10345213
https://avg.163.com/topic/detail/10345212
https://avg.163.com/topic/detail/10344998
https://avg.163.com/topic/detail/10345208
https://avg.163.com/topic/detail/10345078
https://avg.163.com/topic/detail/10345204
https://avg.163.com/topic/detail/10345201
https://avg.163.com/topic/detail/10345194
https://avg.163.com/topic/detail/10345086
https://avg.163.com/topic/detail/10345623
https://avg.163.com/topic/detail/10345622
https://avg.163.com/topic/detail/10345621
https://avg.163.com/topic/detail/10345620
https://avg.163.com/topic/detail/10345619
https://avg.163.com/topic/detail/10345617
https://avg.163.com/topic/detail/10345618
https://avg.163.com/topic/detail/10345616
https://avg.163.com/topic/detail/10345615
https://avg.163.com/topic/detail/10345614
https://avg.163.com/topic/detail/10345612
https://avg.163.com/topic/detail/10345611
https://avg.163.com/topic/detail/10345610
https://avg.163.com/topic/detail/10345609
https://avg.163.com/topic/detail/10345608
https://avg.163.com/topic/detail/10345607
https://avg.163.com/topic/detail/10345606
https://avg.163.com/topic/detail/10345604
https://avg.163.com/topic/detail/10345603
https://avg.163.com/topic/detail/10345602
https://avg.163.com/topic/detail/10345601
https://avg.163.com/topic/detail/10345600
https://avg.163.com/topic/detail/10345598
https://avg.163.com/topic/detail/10345599
https://avg.163.com/topic/detail/10345597
https://avg.163.com/topic/detail/10345596
https://avg.163.com/topic/detail/10345595
https://avg.163.com/topic/detail/10345594
https://avg.163.com/topic/detail/10345593
https://avg.163.com/topic/detail/10345592
https://avg.163.com/topic/detail/10345591
https://avg.163.com/topic/detail/10345590
https://avg.163.com/topic/detail/10345589
https://avg.163.com/topic/detail/10345586
https://avg.163.com/topic/detail/10345587
https://avg.163.com/topic/detail/10345585
https://avg.163.com/topic/detail/10345583
https://avg.163.com/topic/detail/10345582
https://avg.163.com/topic/detail/10345457
https://avg.163.com/topic/detail/10345581
https://avg.163.com/topic/detail/10345578
https://avg.163.com/topic/detail/10345580
https://avg.163.com/topic/detail/10345579
https://avg.163.com/topic/detail/10345577
https://avg.163.com/topic/detail/10345576
https://avg.163.com/topic/detail/10345575
https://avg.163.com/topic/detail/10345574
https://avg.163.com/topic/detail/10345572
https://avg.163.com/topic/detail/10345571
https://avg.163.com/topic/detail/10345569
https://avg.163.com/topic/detail/10345570
https://avg.163.com/topic/detail/10345567
https://avg.163.com/topic/detail/10345455
https://avg.163.com/topic/detail/10345565
https://avg.163.com/topic/detail/10345566
https://avg.163.com/topic/detail/10345564
https://avg.163.com/topic/detail/10345515
https://avg.163.com/topic/detail/10345563
https://avg.163.com/topic/detail/10345562
https://avg.163.com/topic/detail/10345561
https://avg.163.com/topic/detail/10345560
https://avg.163.com/topic/detail/10345559
https://avg.163.com/topic/detail/10345558
https://avg.163.com/topic/detail/10345457
https://avg.163.com/topic/detail/10345557
https://avg.163.com/topic/detail/10345556
https://avg.163.com/topic/detail/10345554
https://avg.163.com/topic/detail/10345553
https://avg.163.com/topic/detail/10345555
https://avg.163.com/topic/detail/10345551
https://avg.163.com/topic/detail/10345550
https://avg.163.com/topic/detail/10345549
https://avg.163.com/topic/detail/10345548
https://avg.163.com/topic/detail/10345547
https://avg.163.com/topic/detail/10345546
https://avg.163.com/topic/detail/10345519
https://avg.163.com/topic/detail/10345545
https://avg.163.com/topic/detail/10345542
https://avg.163.com/topic/detail/10345543
https://avg.163.com/topic/detail/10345541
https://avg.163.com/topic/detail/10345540
https://avg.163.com/topic/detail/10345539
https://avg.163.com/topic/detail/10345538
https://avg.163.com/topic/detail/10345537
https://avg.163.com/topic/detail/10345535
https://avg.163.com/topic/detail/10345536
https://avg.163.com/topic/detail/10345534
https://avg.163.com/topic/detail/10345533
https://avg.163.com/topic/detail/10345532
https://avg.163.com/topic/detail/10345531
https://avg.163.com/topic/detail/10345529
https://avg.163.com/topic/detail/10345530
https://avg.163.com/topic/detail/10345528
https://avg.163.com/topic/detail/10345527
https://avg.163.com/topic/detail/10345526
https://avg.163.com/topic/detail/10345525
https://avg.163.com/topic/detail/10345421
https://avg.163.com/topic/detail/10345523
https://avg.163.com/topic/detail/10345524
https://avg.163.com/topic/detail/10345522
https://avg.163.com/topic/detail/10345481
https://avg.163.com/topic/detail/10345455
https://avg.163.com/topic/detail/10345521
https://avg.163.com/topic/detail/10345520
https://avg.163.com/topic/detail/10345467
https://avg.163.com/topic/detail/10345519
https://avg.163.com/topic/detail/10345518
https://avg.163.com/topic/detail/10345517
https://avg.163.com/topic/detail/10345516
https://avg.163.com/topic/detail/10345515
https://avg.163.com/topic/detail/10345421
https://avg.163.com/topic/detail/10345514
https://avg.163.com/topic/detail/10345512
https://avg.163.com/topic/detail/10345513
https://avg.163.com/topic/detail/10345511
https://avg.163.com/topic/detail/10345460
https://avg.163.com/topic/detail/10345510
https://avg.163.com/topic/detail/10345509
https://avg.163.com/topic/detail/10345508
https://avg.163.com/topic/detail/10345507
https://avg.163.com/topic/detail/10345505
https://avg.163.com/topic/detail/10345504
https://avg.163.com/topic/detail/10345454
https://avg.163.com/topic/detail/10345503
https://avg.163.com/topic/detail/10345463
https://avg.163.com/topic/detail/10345466
https://avg.163.com/topic/detail/10345500
https://avg.163.com/topic/detail/10345436
https://avg.163.com/topic/detail/10345419
https://avg.163.com/topic/detail/10345501
https://avg.163.com/topic/detail/10345499
https://avg.163.com/topic/detail/10345498
https://avg.163.com/topic/detail/10345497
https://avg.163.com/topic/detail/10345496
[root@www ~]# mkfs[tab][tab] mkfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.msdos mkfs.vfat
按下两个[tab],会发现 mkfs 支持的文件格式如上所示。
实例 2
将分区 /dev/hdc6(可指定你自己的分区) 格式化为 ext3 文件系统:
[root@www ~]# mkfs -t ext3 /dev/hdc6
mke2fs 1.39 (29-May-2006)
Filesystem label= <==这里指的是分割槽的名称(label)
OS type: Linux
Block size=4096 (log=2) <==block 的大小配置为 4K
Fragment size=4096 (log=2)
251392 inodes, 502023 blocks <==由此配置决定的inode/block数量
25101 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=515899392
16 block groups
32768 blocks per group, 32768 fragments per group
15712 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (8192 blocks): done <==有日志记录
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# 这样就创建起来我们所需要的 Ext3 文件系统了!简单明了!









