阿里云ECS服务器(linux)挂载硬盘
2016-03-24 16:55
639 查看
阿里云ECS服务器(linux)挂载硬盘
1.查看系统挂载
[root@iZ234wzhfriZ ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 2.3G 36G 7% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
2.查看磁盘列表(vdb还没有进行分区)
[root@iZ234wzhfriZ ~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 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: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/vda1 * 1 5222 41940992 83 Linux
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
3.分区:
fdisk /dev/vdb
[root@iZ234wzhfriZ ~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 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: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/vda1 * 1 5222 41940992 83 Linux
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1ef51bc1
Device Boot Start End Blocks Id System
/dev/vdb1 1 208050 104857168+ 83 Linux
4.格式分区/dev/vdb1:
mkfs.ext4 /dev/vdb1
[root@iZ234wzhfriZ ~]# mkfs.ext4 /dev/vdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214292 blocks
1310714 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
5.挂载:
创建挂载目录
[root@iZ234wzhfriZ /]# mkdir data
mount /dev/vdb1 /data
[root@iZ234wzhfriZ /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 2.3G 36G 7% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/vdb1 99G 188M 94G 1% /data
6.把挂载配置/etc/fstab中重启会自动挂载
# /etc/fstab
# Created by anaconda on Thu Aug 14 21:16:42 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=94e4e384-0ace-437f-bc96-057dd64f42ee / ext4 defaults,barrier=0 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/vdb1 /data ext4 defaults 0 0
1.查看系统挂载
[root@iZ234wzhfriZ ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 2.3G 36G 7% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
2.查看磁盘列表(vdb还没有进行分区)
[root@iZ234wzhfriZ ~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 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: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/vda1 * 1 5222 41940992 83 Linux
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
3.分区:
fdisk /dev/vdb
[root@iZ234wzhfriZ ~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 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: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/vda1 * 1 5222 41940992 83 Linux
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1ef51bc1
Device Boot Start End Blocks Id System
/dev/vdb1 1 208050 104857168+ 83 Linux
4.格式分区/dev/vdb1:
mkfs.ext4 /dev/vdb1
[root@iZ234wzhfriZ ~]# mkfs.ext4 /dev/vdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214292 blocks
1310714 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
5.挂载:
创建挂载目录
[root@iZ234wzhfriZ /]# mkdir data
mount /dev/vdb1 /data
[root@iZ234wzhfriZ /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 2.3G 36G 7% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/vdb1 99G 188M 94G 1% /data
6.把挂载配置/etc/fstab中重启会自动挂载
# /etc/fstab
# Created by anaconda on Thu Aug 14 21:16:42 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=94e4e384-0ace-437f-bc96-057dd64f42ee / ext4 defaults,barrier=0 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/vdb1 /data ext4 defaults 0 0
相关文章推荐
- linux命令---find
- linux系统调用---getrlimit()与setrlimit()
- CentOS 7 安装mysql(在线安装版)
- linux下多个cpp文件的Makefile编译
- Linux设备驱动之——I2C总线
- CentOS 7下的软件安装方法及策略
- Linux下TFTP的安装,配置和操作
- 程序包管理工具yum
- Linux中find常见用法示例
- linux 查看文件内容的命令
- Android Linux Kernel 移植流程
- linux命令---sort
- Android Linux内核编译调试
- python调用linux命令
- 每天一个linux命令(60):scp命令 【转】
- Linux下SVN服务器的搭建
- 跨平台linux, windows, android系统识别
- linux 配置Socks5
- Linux下Samba服务器搭建
- Linux安装mysql 缺少ncurses-devel包