傲游出于数据保护机制,我们都会给客户准备2块硬盘,一块用来存放用户数据(即网站数据等),一块用来存放系统,这样在您的系统出现问题之后后台选择重装系统,另外一个磁盘分区的数据就不会丢失了,所以在购买VPS之后,要手动将另外一块硬盘挂载到用户数据的目录。这个机制有一个缺点就是存放系统的分区将无法应用于用户数据(网站数据等),不过如果您需要充分利用您的磁盘,您可以挂载磁盘为LVM格式,请注意,LVM挂载方式重装系统将会丢失所有数据

进行磁盘挂载前,请注意备份数据!
本脚本仅适用于新的遨游主机VPS服务
本教程仅适用于Linux系统

当您的VPS开通后,使用SSH登录到您的VPS,会显示如下提示:

Dear customer,

The second disk of your vps is not mounted yet.     Please run

"./AutoTools.sh" to mount your second disk.

                    Yours sincerely,
                    Aoyouhost.com

该提示告诉您,您的第二块磁盘可能需要挂载,此时您可以手动挂载/dev/xvdb磁盘或使用我们提供的挂载脚本。

您可以执行以下命令开始挂载步奏:

在SSH中执行:sh /root/AutoTools.sh
将会提示以下选项:

AoyouHost AutoMount for XenSystem
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Operating risk, only use new VPS
Press Ctrl + C to cancel
1.Mount second disk with LVM mode
2.Mount second disk with ext3 mode
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Enter your choice:

1.挂载第二块硬盘为LVM(合并系统盘与数据盘,重装系统会丢失所有数据)
注:使用Lvm挂载将会自动重启VPS。
2.挂载第二块硬盘位ext3(重装系统不会丢失,将挂载至/home目录)

选您所需要的挂载方式,比如需要挂载至/home目录请输入“2”
此时会提示:

AoyouHost AutoEXT for XenSystem
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Operating risk, only use new VPS (磁盘挂载有数据丢失风险,仅限于新的VPS使用)
Press Ctrl + C to cancel Any key to continue (您可以使用Ctrl+C终止本次操作或按任意键开始挂载)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

按下任意键开始操作后,请等待操作完毕:

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): Command action e extended p primary
partition (1-4) Partition number (1-4): First cylinder (1-652, default
1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G}
(1-652, default 652): Using default value 652

Command (m for help): The partition table has been altered!

Calling ioctl() to re-read partition table. Syncing disks. 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 327680 inodes, 1309289 blocks 65464 blocks (5.00%) reserved for
the super user First data block=0 Maximum filesystem blocks=1342177280
40 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

Writing inode tables: done Creating
journal (32768 blocks): done Writing superblocks and filesystem
accounting information: done

This filesystem will be automatically checked every 33 mounts or 180
days, whichever comes first. Use tune2fs -c or -i to override.

此时,您可以使用df -lh查看磁盘大小是否正常:

[root@MyCloudServer ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_501153278-lv_root

                  8.4G  922M  7.1G  12% /

tmpfs 249M 0 249M 0% /dev/shm
/dev/xvda1 485M 84M 376M 19% /boot
/dev/xvdb1 5.0G 139M 4.6G 3% /home

若以上地址无法下载挂载脚本,请尝试以下命令:

rm -rf AutoToolsWget.sh;
wget http://my.aoyouhost.com/scripts/AutoToolsWget.sh;
chmod +x AutoToolsWget.sh;
sh AutoToolsWget.sh;

标签: linux

评论已关闭