linux下安装新硬盘并挂载mount
来源:互联网 发布:网页淘宝登录异常 编辑:程序博客网 时间:2024/05/21 08:04
一、过程步骤:
1、首先是添加新硬盘,本人是在虚拟机下添加的:VM >>Settings >> Hardware >> Add >> Hard Disk >> 一路默认。。。
2、fdisk -l //查看是否找到新硬盘,查看硬盘代号。
3、fdisk /dev/sdb //找到代号为sdb的新硬盘(创建分区sdb1)
4、mkfs.ext4 /dev/sdb1 //把新硬盘格式化成ext4文件系统
5、mkdir disk2 //创建新的挂载点(一般cd到/mnt目录下进行创建)
6、mount /dev/sdb1 /disk2 //手动挂载分区,把硬盘挂到/disk2目录下
7、vi /etc/fstab 进入编辑模式,添加 /dev/sdb1 /disk2 ext4 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.
4、创建挂载点
[root@AMD-LINUX ~]# mkdir /disk2
[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×623223a1
Device Boot Start End Blocks Id System
/dev/sdb1 1 261 2096451 83 Linux
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
[root@AMD-LINUX ~]# mkfs.ext4 /dev/sdb1 => //把新硬盘格式化成ext4文件系统
mke2fs 1.40.2 (12-Jul-2007)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
262144 inodes, 524112 blocks
26205 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
5、设置为开机自动挂载分区
[root@AMD-LINUX ~]# vi /etc/fstab
/dev/sdb1 /disk2 ext3 auto 1 2
6、手动挂载分区
[root@AMD-LINUX ~]# mount /dev/sdb1 /disk2/
- linux下安装新硬盘并挂载mount
- linux下安装新硬盘并加载
- Linux mount 硬盘挂载
- VMware下Linux系统新mount一个硬盘的方式
- linux 下mount linux硬盘
- LINUX下新硬盘挂载
- RedHat虚拟机下mount新硬盘
- linux 挂载硬盘并分区最后mount到系统上。
- linux格式化新硬盘并自动挂载
- inux下安装新硬盘并加载使用手记
- linux CentOS 下添加新硬盘并分区格式化
- Linux下Mount第二块硬盘
- 在linux下mount windows硬盘
- Linux下添加新硬盘,分区及挂载
- Linux下添加新硬盘,然后分区及挂载
- Linux下添加新硬盘,分区及挂载
- Linux下添加新硬盘,分区及挂载
- Linux下添加新硬盘,分区及挂载
- 利用bu命令下延迟断点
- hdu 1007 Quoit Design(分治求最近点对)
- 正则表达式使用学习
- PHP中spl_autoload_register函数的用法
- 在 Vmware 上安装 MacOS 10.9
- linux下安装新硬盘并挂载mount
- 穷举法解决组合问题
- wifi常用命令
- Java中的基本类型与封装类型以及自动装箱、拆箱
- introduction to mongoDB(介绍 mongodb)
- Android Json生成及解析实例
- 二叉树的实现
- shell脚本学习之简单熟悉
- ServerSocket和Socket建立通信(客户端发送消息服务器接收输出)