如果您想添加一个新的分区,或者增加一个新的硬盘,您要通过分区工具来添加分区,然后要创建分区的文件系统,然后才是挂载文件系统;比如通过mount 加载,或者通过修改 /etc/fstab来开机自动加载;
这里的文件系统是要指定的,比如 ext3 ;reiserfs ;ext2 ;fat32 ;msdos 等... ...
设备比如是一个硬盘的分区,软盘,光驱等.. ...
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
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.
[root@localhost]# chmod 777 /mnt/sda6
[root@localhost]# mount /dev/sda6 /mnt/sda6
[root@localhost]# mkfs -t ext2 /dev/sda6
[root@localhost]# mkfs -t reiserfs /dev/sda6
[root@localhost]# mkfs -t fat32 /dev/sda6
[root@localhost]# mkfs -t msdos /dev/sda6
... ...
2)mkfs.ext3 mkfs.reiserfs mkfs.ext2 mkfs.msdos mkfs.vfat mke2fs 的介绍;
[root@localhost]# mke2fs -j /dev/sda6 注:把该设备格式化成ext3文件系统
[root@localhost]# mkfs.ext2 /dev/sda6 注:把该设备格式化成ext2文件系统
root@localhost]# mke2fs /dev/sda6 注:把该设备格式化成ext2文件系统
[root@localhost]# mkfs.reiserfs /dev/sda6 注:把该设备格式化成reiserfs文件系统
[root@localhost]# mkfs.vfat /dev/sda6 注:把该设备格式化成fat32文件系统
[root@localhost]# mkfs.msdos /dev/sda6 注:把该设备格式化成fat16文件系统,msdos文件系统就是fat16;
[root@localhost]# mkdosfs /dev/sda6 注:把该设备格式化成fat16文件系统,同mkfs.msdos
... ...
[root@localhost]# swapon /dev/sda6 注:加载交换分区;
[root@localhost]# swapoff /dev/sda6 注:关闭交换分区;
[root@localhost]# swapon -s
Filename Type Size Used Priority
/dev/hda7 partition 787144 0 -1
/dev/sda6 partition 225144 0 -3
/dev/sda6 swap swap defaults 0 0 注:把此行中的/dev/hda7 改为您的交换分区就行;
读入了 524288+0 个块
输出了 524288+0 个块
[root@localhost]# mkswap /tmp/swap 注:把/tmp/swap 文件,创建成swap 交换区
Setting up swapspace version 1, size = 536866 kB
no label, UUID=d9d8645d-92cb-4d33-b36e-075bb0a2e278
[root@localhost]# swapon /tmp/swap 注:挂载swap
[root@localhost]# swapon -s
Filename Type Size Used Priority
/dev/hda7 partition 787144 888 -1
/tmp/swap file 524280 0 -2