linux添加新硬盘-添加到开机自动挂载
2016-11-29 14:20
495 查看
有时候系统硬盘不够用,这时候需要添加新的硬盘,创建文件系统,挂载到新的目录。如果不把挂载加到开机启动,机器重启后,新挂载的硬盘里的内容就会访问不到,这时候就需要开机启动的时候自动挂载。
1.fdisk -l 查看磁盘信息
[root@test1 etc]# fdisk -l
Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007c1f4
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1502 12057600 83 Linux
/dev/sda2 1502 1567 524288 82 Linux swap / Solaris
Disk /dev/sdb: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x999df6f7
Device Boot Start End Blocks Id System
/dev/sdb1 1 6527 52428096 83 Linux
Disk /dev/mapper/vg01-lv01: 53.7 GB, 53682896896 bytes
255 heads, 63 sectors/track, 6526 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
2.挂载磁盘
[root@test1 ~]#
mount /dev/mapper/vg01-lv01 /xebest 把vg01挂载到 /xebest 目录
3.添加开机启动
vi /etc/fstab
添加以下代码:
/dev/mapper/vg01-lv01 /xebest ext4 defaults 0 0
- device name,设备名,例如/dev/sdb1
- mount point,挂载点,是一个系统上存在的文件夹,例如/xebest
- fs-type,要挂载设备的类型,例如ext4。用man fstab可以查到支持的类型。
- options,挂载时采用的参数,一般是defaults。
- dump-freq 和 pass-num,一般都设置为0,启动时不检查要挂载的设备。
或者 在/etc/rc.local 添加 mount /dev/mapper/vg01-lv01 /xebest
不过不推荐放在这里,因为系统启动完之后,最后加载这个配置文件,推荐放在 /etc/fstab里面
有时候系统硬盘不够用,这时候需要添加新的硬盘,创建文件系统,挂载到新的目录。如果不把挂载加到开机启动,机器重启后,新挂载的硬盘里的内容就会访问不到,这时候就需要开机启动的时候自动挂载。
1.fdisk -l 查看磁盘信息
[root@test1 etc]# fdisk -l
Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007c1f4
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1502 12057600 83 Linux
/dev/sda2 1502 1567 524288 82 Linux swap / Solaris
Disk /dev/sdb: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x999df6f7
Device Boot Start End Blocks Id System
/dev/sdb1 1 6527 52428096 83 Linux
Disk /dev/mapper/vg01-lv01: 53.7 GB, 53682896896 bytes
255 heads, 63 sectors/track, 6526 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
2.挂载磁盘
[root@test1 ~]#
mount /dev/mapper/vg01-lv01 /xebest 把vg01挂载到 /xebest 目录
3.添加开机启动
vi /etc/fstab
添加以下代码:
/dev/mapper/vg01-lv01 /xebest ext4 defaults 0 0
- device name,设备名,例如/dev/sdb1
- mount point,挂载点,是一个系统上存在的文件夹,例如/xebest
- fs-type,要挂载设备的类型,例如ext4。用man fstab可以查到支持的类型。
- options,挂载时采用的参数,一般是defaults。
- dump-freq 和 pass-num,一般都设置为0,启动时不检查要挂载的设备。
或者 在/etc/rc.local 添加 mount /dev/mapper/vg01-lv01 /xebest
不过不推荐放在这里,因为系统启动完之后,最后加载这个配置文件,推荐放在 /etc/fstab里面
相关文章推荐
- 20151117 Linux下磁盘管理(centos 6.5)1.添加硬盘 2.硬盘分区 3.格式化硬盘 4.挂载硬盘 5.设置开机自动挂载】
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘自动挂载硬盘
- Linux添加新硬盘、分区、格式化、自动挂载
- linux格式化新硬盘并挂载并设置开机自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- linux下如何挂载硬盘 以及让硬盘开机自动挂载
- linux硬盘开机自动挂载
- linux挂载新硬盘,开机自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- linux格式化新硬盘并挂载,设置开机自动挂载
- Linux分区挂载硬盘并实现开机自动挂载的步骤详解
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载
- linux格式化新硬盘并挂载,设置开机自动挂载
- Linux添加硬盘与fdisk分区、mke2fs格式化分区、自动挂载
- Linux添加新硬盘、分区、格式化、自动挂载