开发者社区> 问答> 正文

阿里云服务器数据盘挂载


最近发现阿里云服务器的磁盘快不够满了(df -lh), 登录阿里云控制面板查看原来还有一块数据盘没用,原来阿里云服务器的数据盘默认是不会自动挂载的。
开始挂载:
首先使用 SSH登陆到阿里云服务器,比如:SecureCRT ,Putty ...
1.先查看哪一块没挂载好: fdisk -l
[root@AY************** ~]# fdisk -l
Disk /dev/hda: 21.4 GB, 21474836480 bytes 224 heads, 56 sectors/track, 3343 cylinders Units = cylinders of 12544 * 512 = 6422528 bytes
Device Boot Start End Blocks Id System /dev/hda1 * 1 3343 20967268 83 Linux
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes 224 heads, 56 sectors/track, 8359 cylinders Units = cylinders of 12544 * 512 = 6422528 bytes
Disk /dev/xvdb doesn't contain a valid partition table
2. 然后 fdisk /dev/xvdb  ,注意红色部分,绿色这里有按回车 默认即可。
[root@AY************** ~]# fdisk /dev/xvdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable.
The number of cylinders for this disk is set to 8359. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-8359, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-8359, default 8359): Using default value 8359
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
3. 格式化分区 mkfs.ext3 /dev/xvdb1
[root@AY************** ~]# mkfs.ext3 /dev/xvdb1
mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux
.........................
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.
4.挂载分区,先要在根目录建立data0(mkdir /data0),才能完成挂载。
mount /dev/xvdb1 /data0/
5.设置开机自动挂载
vi /etc/fstab
/dev/xvdb1              /data                   ext3    defaults        0 0
6.查看挂载情况:
[root@AY************** ~]# df -lh Filesystem Size Used Avail Use% Mounted on /dev/hda1 20G 14G 4.7G 75% / tmpfs 1006M 0 1006M 0% /dev/shm /dev/xvdb1 50G 180M 47G 1% /data0
成功!

展开
收起
qinfang 2014-09-24 13:57:28 16479 0
2 条回答
写回答
取消 提交回答
  • Re阿里云服务器数据盘挂载
    支持windows系统吗
    2015-12-17 11:07:44
    赞同 展开评论 打赏
  • 欢迎进行技术分享,感谢你的支持!
    2014-09-26 19:40:43
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS快储存加密技术 立即下载