手工格式化硬盘
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
手工格式化硬盘
# fdisk /dev/sda //进入分割硬盘模式
The number of cylinders for this disk is set to 19457.
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): d //删除一个分区
Selected partition 1
Command (m for help): w //写入磁盘退出分区程序,按w这个分区就等于是删除了
The partition table has been altered!
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
重启
# fdisk /dev/sda
The number of cylinders for this disk is set to 19457.
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): n //添加一个新分区
Command action
e extended
p primary partition (1-4)
P //显示分区表
Partition number (1-4): 1
First cylinder (1-19457, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):
Using default value 19457
Command (m for help): w //按下w 保存退出皆可,分区工作结束The partition table has been altered!
Calling ioctl() to re-read partition table
# umount /mnt/usb1 //卸载文件系统,/mnt/usb1是磁盘挂载目录
# mkfs.ext3 /dev/sda1 //格式化,其中/dev/sda1是硬盘分区名,而不是硬盘设备名mke2fs 1.41.5 (23-Apr-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
9773056 inodes, 39072080 blocks
1953604 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1193 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
#
重启动
fdisk -l /dev/sda ,观察硬盘之实体使用情形,可以查看磁盘格式化情况
附录:
按m是显示命令帮助
出现如下界面
Command action
a toggle a bootable flag 设置引导扇区
b edit bsd disklabel 编辑卷标(linux下使用的卷标bsd通用)
c toggle the dos compatibility flag
d delet
e a partition 删除一个分区
l list known partition types 列出已知分区类型
m print this menu 显示该菜单