博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
新增数据盘
阅读量:5286 次
发布时间:2019-06-14

本文共 5536 字,大约阅读时间需要 18 分钟。

第一步:在阿里云创建云盘(必须和挂载的服务器是一个区域一个分区)

            购买完之后在阿里云上面先挂载

第二步:创建磁盘分区

[root@iZj6c45wku1lv9c4w5dlpqZ ~]# 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: 0x00020f03

Device Boot Start End Blocks Id System

/dev/vda1 * 1 5222 41940992 83 Linux

Disk /dev/vdb: 128.8 GB, 128849018880 bytes

16 heads, 63 sectors/track, 249660 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

对未分区磁盘进行分区

[root@iZj6c45wku1lv9c4w5dlpqZ ~]# fdisk /dev/vdb 

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x78851959.
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 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): m 查看帮助

Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n 新增加分区

Command action
e extended
p primary partition (1-4)
p 基本分区
Partition number (1-4): 1 分区编号
First cylinder (1-249660, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-249660, default 249660):
Using default value 249660

Command (m for help): w 写入修改

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.
[root@iZj6c45wku1lv9c4w5dlpqZ ~]#
[root@iZj6c45wku1lv9c4w5dlpqZ ~]# 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: 0x00020f03

Device Boot Start End Blocks Id System

/dev/vda1 * 1 5222 41940992 83 Linux

Disk /dev/vdb: 128.8 GB, 128849018880 bytes

16 heads, 63 sectors/track, 249660 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: 0x78851959

Device Boot Start End Blocks Id System

/dev/vdb1 1 249660 125828608+ 83 Linux

 

 将新建分区格式为ext4格式

[root@iZj6c45wku1lv9c4w5dlpqZ ~]# mkfs -t ext4 /dev/vdb1 将新建分区格式为ext4格式
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
7864320 inodes, 31457152 blocks
1572857 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
960 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 37 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@iZj6c45wku1lv9c4w5dlpqZ ~]# 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: 0x00020f03

Device Boot Start End Blocks Id System

/dev/vda1 * 1 5222 41940992 83 Linux

Disk /dev/vdb: 128.8 GB, 128849018880 bytes

16 heads, 63 sectors/track, 249660 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: 0x78851959

Device Boot Start End Blocks Id System

/dev/vdb1 1 249660 125828608+ 83 Linux

第三步:挂载上要指定的目录(当挂载的目录下面有数据的时候把数据移出再挂载,否则挂载上目录下面会没有数据)

[root@iZj6c45wku1lv9c4w5dlpqZ ~]# mount /dev/vdb1 /mnt 将分区挂载到/mnt下
[root@iZj6c45wku1lv9c4w5dlpqZ ~]#

 

第四步:可以设置开机自动挂载

[root@iZj6c45wku1lv9c4w5dlpqZ ~]#
[root@iZj6c45wku1lv9c4w5dlpqZ ~]# blkid 查看磁盘UUID
/dev/vda1: UUID="a3b07a51-3009-4ddf-9240-81333f13880e" TYPE="ext4"
/dev/vdb1: UUID="883cb023-0e52-45d0-bc4f-a40b0247bd99" TYPE="ext4"
[root@iZj6c45wku1lv9c4w5dlpqZ ~]#
[root@iZj6c45wku1lv9c4w5dlpqZ ~]#

[root@iZm5e9eb5azhksxowz185wZ ~]# cat /etc/fstab

#

# /etc/fstab
# Created by anaconda on Fri Feb 24 02:58:22 2017
#
# 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=07151862-c2b9-45dc-bfndfasdssddfcadd   / ext3 defaults 1 1
UUID="a3b07a51-3009-4ddf-9240-81333f13880e  /mnt ext4 defaults 0 0

[root@iZm5e9eb5azhksxowz185wZ ~]#

转载于:https://www.cnblogs.com/xy51/p/9603543.html

你可能感兴趣的文章
【转】JMeter学习(一)工具简单介绍
查看>>
使用sockopt与内核交换数据
查看>>
Windows系统默认调试器设置
查看>>
【题解】[USACO12JAN]视频游戏的连击Video Game Combos
查看>>
bzoj1826: [JSOI2010]缓存交换(贪心+priority_queue)
查看>>
java拓荒者
查看>>
SP2010开发和VS2010专家"食谱"--第一章节--列表和事件接收器(3)--开发者仪表板
查看>>
EXTJS4自学手册——EXT基本方法、属性(onReady、define、create)
查看>>
MYSQL INSERT DELAYED
查看>>
阅读-阿里如何实现秒级百万TPS?搜索离线大数据平台架构解读
查看>>
实验五
查看>>
iview自定义配置
查看>>
C++容器操作
查看>>
js移动端滑块验证解锁组件
查看>>
QTP函数使用(实战系列三)
查看>>
解决eclipse building workspace慢的情况
查看>>
Linux系统启动详解(一)
查看>>
web应用BaseDao及BaseDaoImpl
查看>>
word怎么在方框中打对号
查看>>
PHP扩展--vld查看opcode代码
查看>>