技术解析

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

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

[[email protected] ~]# 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

[[email protected] ~]# 

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


有用 lvm,只有 root 和 swap,扩容直接加到 root 上就行了

感谢提供思路,参考 https://www.cnblogs.com/jackruicao/p/6258820.html 实现了扩容

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服