V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
viptot
V2EX  ›  Linux

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

  •  
  •   viptot · 2019-03-16 17:03:02 +08:00 · 1206 次点击
    这是一个创建于 1865 天前的主题,其中的信息可能已经有所发展或是发生改变。

    今日突然发现 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 上面去,但是同时想要保证环境与网站能正常运作

    willis
        1
    willis  
       2019-03-16 17:46:22 +08:00 via iPhone   ❤️ 1
    有用 lvm,只有 root 和 swap,扩容直接加到 root 上就行了
    viptot
        2
    viptot  
    OP
       2019-03-17 10:10:42 +08:00
    @willis 感谢提供思路,参考 https://www.cnblogs.com/jackruicao/p/6258820.html 实现了扩容
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1182 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 18:17 · PVG 02:17 · LAX 11:17 · JFK 14:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.