之前发的那篇《Xen Linux VPS硬盘挂载教程》,利用LVM(卷组)直接填充整个Linux根分区的磁盘容量,这种做法可以最大限度的利用VPS所分配的容量,但重装后会丢失所有数据。适合一些比较小硬盘或对硬盘需求量比较大的客户。
由于现在的VPS磁盘容量越来越大,很多VPSer们也未必能用得到默认的容量,XenSystem初始化的根分区(第一磁盘“Xvda”)默认为10G,另外一个磁盘(第二磁盘“Xvdb”)为VPS总容量的剩余容量。如果单独挂载给/home,使用LNMP一键包等程序,在重装时在/home内的数据就不会丢失了。非常适合热爱折腾的客户。
[root@MyServer ~]# fdisk /dev/xvdb Command (m for help): n 新建分区 Command action e extended p primary partition (1-4) p 分区类型 Partition number (1-4): 1 分区编号 First cylinder (1-1305, default 1):1 Using default value 1 分区起始位置,默认即可 Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305): 1305 结束位置,默认即可 Command (m for help): t 指定分区格式 Selected partition 1 Hex code (type L to list codes): 83 设置为Linux分区 Changed system type of partition 1 to 8e (Linux LVM) Command (m for help): w 保存 The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.