在机器添加了新的硬盘之后,需要对其进行分区、创建文件系统并挂载之后,才能使用。具体步骤如下
1、使用fdisk命令给硬盘分区
- # fdisk /dev/sdb
- Command (m for help): p
- Disk /dev/sdb: 21.4 GB, 21474836480 bytes
- 255 heads, 63 sectors/track, 2610 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- Command (m for help): n
- Command action
- e extended
- p primary partition (1-4)
- p
- Partition number (1-4): 1
- First cylinder (1-2610, default 1):
- Using default value 1
- Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
- Using default value 2610
- Command (m for help): w ----将改动写入磁盘
- The partition table has been
2、使用mkfs格式化硬盘- # fdisk -l /dev/sdb
- Disk /dev/sdb: 21.4 GB, 21474836480 bytes
- 255 heads, 63 sectors/track, 2610 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
- Device Boot Start End Blocks Id System
- /dev/sdb1 1 2610 20964793+ 83 Linux
- perl-219-sles10:~ # mkfs -t ext3 /dev/sdb1
- ...
- Writing inode tables: done
- Creating journal (32768 blocks): done
- Writing superblocks and filesystem accounting information: ----直接回车
3、挂载mount /dev/sdb1 /newfs
4、配置开机自动挂载编辑/etc/fstab 文件
添加:/dev/sdb1 /newfs ext3 defaults 1 1
阅读(850) | 评论(0) | 转发(0) |