一、查看分区情况
fdisk -l
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
二、磁盘分区
fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-26108, default 1): 直接回车
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-26108, default 26108):直接回车
Using default value 26108
Command (m for help): w
The partition table has been altered!
三、再次查看分区情况
fdisk -l
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 26108 209712478+ 83 Linux
四、格式化分区
mkfs -t ext3 /dev/sdb1
五、挂载分区
mount /dev/sdb1 /home/filebackup
查看挂载情况
df -hl
/dev/sdb1 197G 188M 187G 1% /home/filebackup
六、设置开机自动挂载
cp /etc/fstab /etc/fstab.bak
vi /etc/fstab
/dev/sdb1 /home/filebackup ext3 defaults 0 0
七、重启服务器测试自动挂载
reboot
fdisk -l
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
二、磁盘分区
fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-26108, default 1): 直接回车
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-26108, default 26108):直接回车
Using default value 26108
Command (m for help): w
The partition table has been altered!
三、再次查看分区情况
fdisk -l
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 26108 209712478+ 83 Linux
四、格式化分区
mkfs -t ext3 /dev/sdb1
五、挂载分区
mount /dev/sdb1 /home/filebackup
查看挂载情况
df -hl
/dev/sdb1 197G 188M 187G 1% /home/filebackup
六、设置开机自动挂载
cp /etc/fstab /etc/fstab.bak
vi /etc/fstab
/dev/sdb1 /home/filebackup ext3 defaults 0 0
七、重启服务器测试自动挂载
reboot