[root@www ~]# df /<==注意:重点在找出磁盘文件名而已Filesystem1K-blocks UsedAvailableUse%Mounted on
/dev/hdc2 99206243823168558538841%/[root@www ~]# fdisk /dev/hdc <==仔细看,不要加上数字喔!The number of cylinders forthis disk isset to 5005.Thereis nothing wrong with that, but thisis 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 printthis 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 时按下 ,那么所有的动作都不会生效!相反的, 按下就是动作生效的意思。
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 <==每个磁柱的大小DeviceBootStartEndBlocksIdSystem/dev/hdc1 *11310439183Linux/dev/hdc2 14128810241437+83Linux/dev/hdc3 128919255116702+83Linux/dev/hdc4 19265005247401005Extended/dev/hdc5 19262052102009682Linux swap /Solaris# 装置文件名 启动区否 开始磁柱 结束磁柱 1K大小容量 磁盘分区槽内的系统Command(m for help): q
[root@www ~]# mkfs -t ext3 /dev/hdc6
mke2fs 1.39(29-May-2006)Filesystem label=<==这里指的是分割槽的名称(label)
OS type:LinuxBlock size=4096(log=2)<==block 的大小配置为4KFragment size=4096(log=2)251392 inodes,502023 blocks <==由此配置决定的inode/block数量25101 blocks (5.00%) reserved for the super user
First data block=0Maximum filesystem blocks=51589939216 block groups
32768 blocks per group,32768 fragments per group15712 inodes per groupSuperblock backups stored on blocks:32768,98304,163840,229376,294912Writing inode tables:doneCreating journal (8192 blocks):done<==有日志记录Writing superblocks and filesystem accounting information:doneThis filesystem will be automatically checked every 34 mounts or180 days, whichever comes first.Use tune2fs -c or-i to override.# 这样就创建起来我们所需要的 Ext3 文件系统了!简单明了!
[root@www ~]# mkdir /mnt/hdc6
[root@www ~]# mount /dev/hdc6 /mnt/hdc6
[root@www ~]# df
Filesystem1K-blocks UsedAvailableUse%Mounted on
.....中间省略...../dev/hdc6 19763124207218338363%/mnt/hdc6
磁盘卸载命令 umount语法:
umount [-fn]装置文件名或挂载点
选项与参数:
-f :强制卸除!可用在类似网络文件系统 (NFS) 无法读取到的情况下;
-n :不升级 /etc/mtab 情况下卸除。
卸载/dev/hdc6
[root@www ~]# umount /dev/hdc6
3 篇笔记
Linux 操作系统的文件数据除了文件实际内容外,通常含有非常多的属性,例如 Linux 操作系统的文件权限(rwx)与文件属性(拥有者、群组、时间参数等)。文件系统通常会将这两部分的数据分别存放在不同的区块,权限与属性存放在
inode 中,至于实际数据则放置到 data block 区块中。另外,还有一个超级区块(superblock)会记录整个文件系统的整体信息,包括
inode 与 block 的总量、使用量、剩余量等。