1.fdisk -cul
找到磁盘
2. mkdir /data ## /data 为空目录
3. 格式化磁盘
mkfs.ext4 /dev/vdb
4. 挂载
mount /dev/vdb /data
5. 开机时自动挂载磁盘
vim /etc/fstab
新加一行: /dev/vdb /data ext4 defaults 0 0
#### log
[root@iZj6ccvxma7yo7f8w36wuxZ home]# mkdir /data
[root@iZj6ccvxma7yo7f8w36wuxZ home]# fdisk -cul
Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00053156
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 83886079 41942016 83 Linux
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders, total 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
[root@iZj6ccvxma7yo7f8w36wuxZ home]# mkfs.ext4
mkfs.ext4 mkfs.ext4dev
[root@iZj6ccvxma7yo7f8w36wuxZ home]# mkfs.ext4 /dev/vdb
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, 26214400 blocks
1310720 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 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@iZj6ccvxma7yo7f8w36wuxZ home]# mount /dev/vdb /data
[root@iZj6ccvxma7yo7f8w36wuxZ home]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 37G 899M 98% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/vdb 99G 60M 94G 1% /data
[root@iZj6ccvxma7yo7f8w36wuxZ home]# vim /etc/fstab
阿里云数据盘挂载
最新推荐文章于 2024-06-27 16:53:10 发布