加入收藏 | 设为首页 | 会员中心 | 我要投稿 云计算网_泰州站长网 (http://www.0523zz.com/)- 视觉智能、AI应用、CDN、行业物联网、智能数字人!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

在linux下安装并加载使用新硬盘

发布时间:2016-01-22 06:39:01 所属栏目:Linux 来源:网络整理
导读:一、过程步骤 1、#kudzu //检测新硬件,这一步必须! 2、#fdisk -l //查看是否找到新的硬盘,查看硬盘代号。 3、#fdisk /dev/sdb //为新硬盘分区,例如分成sdb1

一、过程步骤

1、#kudzu //检测新硬件,这一步必须!

2、#fdisk -l //查看是否找到新的硬盘,查看硬盘代号。

3、#fdisk /dev/sdb //为新硬盘分区,例如分成sdb1

#mkfs.ext3 /dev/sdb1 //把新硬盘格式化成ext3格式

4、#mkdir /disk2 //创建新的挂载点

5、#mount /dev/sdb1 /disk2/ //手动挂载分区,把硬盘挂到/disk2目录下。

6、#vi /etc/fstab

/dev/sdb1 /disk2 ext3 auto 1 2 //设置为开机自动挂载分区。

二.详细过程

2、

查看硬盘代号

[root@AMD-LINUX ~]# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0×0007d856

Device Boot Start End Blocks Id System

/dev/sda1 * 1 25 200781 83 Linux

/dev/sda2 26 1305 10281600 8e Linux LVM

Disk /dev/sdb: 2147 MB, 2147483648 bytes <=新硬盘

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0×00000000

Disk /dev/sdb doesn’t contain a valid partition table

Disk /dev/dm-0: 9395 MB, 9395240960 bytes

255 heads, 63 sectors/track, 1142 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0×00000000

Disk /dev/dm-0 doesn’t contain a valid partition table

Disk /dev/dm-1: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0×30307800

Disk /dev/dm-1 doesn’t contain a valid partition table

3、fdisk 分区

[root@AMD-LINUX ~]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0×623223a1.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won’t be recoverable.

Warning: invalid flag 0×0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p <=显示信息

Disk /dev/sdb: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0×623223a1

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 <=分区号为1,即/dev/sdb1

First cylinder (1-261, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):

Using default value 261

Command (m for help): p <=显示分区信息

Disk /dev/sdb: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0×623223a1

Device Boot Start End Blocks Id System

/dev/sdb1 1 261 2096451 83 Linux

Command (m for help): w <=保存退出

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

(编辑:云计算网_泰州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读