问: CentOS6.5 VPS 上新增了分区,如何给现有的网站目录进行扩容或者迁移?

2019-03-16 17:03:02 +08:00
 viptot

今日突然发现 vps 硬盘爆满了,然后才想着要买点容量进行扩容,经检查才发现原来有个分区没用上,坑啊,这服务商,干嘛不全给我加到主盘里面去,非得留一个空的分区给我,然后就想着怎么把它追加到主盘上,查了好久没找到可以实现的方法,大家帮我看看

[root@MyCloudServer ~]# fdisk -l

Disk /dev/xvda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 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: 0x000858c5

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        1306     9972736   8e  Linux LVM

Disk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x0006cde7

    Device Boot      Start         End      Blocks   Id  System

Disk /dev/mapper/vg_have-lv_root: 9168 MB, 9168748544 bytes
255 heads, 63 sectors/track, 1114 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: 0x00000000


Disk /dev/mapper/vg_have-lv_swap: 1040 MB, 1040187392 bytes
255 heads, 63 sectors/track, 126 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: 0x00000000

[root@MyCloudServer ~]# 

我的环境和网站目录都是在主盘 /dev/xvda 的 /www 里面 我想要实现的是 使用 /dev/xvdb 对 /www 进行扩容,如果不能实现那就想要把 /www 转移到 /dev/xvdb 上面去,但是同时想要保证环境与网站能正常运作

1213 次点击
所在节点    Linux
2 条回复
willis
2019-03-16 17:46:22 +08:00
有用 lvm,只有 root 和 swap,扩容直接加到 root 上就行了
viptot
2019-03-17 10:10:42 +08:00
@willis 感谢提供思路,参考 https://www.cnblogs.com/jackruicao/p/6258820.html 实现了扩容

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/545284

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX