记一次服务器磁盘扩容,还好以前折腾过 Linux 命令行。

标签: 

正在查看 3 个帖子:1-3 (共 3 个帖子)
  • 作者
    帖子
  • 诗语
    管理员
    • 文章数量: 5,942
    发帖数:9997
    楼主
    @feibisi

    因为不能随便暴露服务器配置信息,这篇文章仅做存档,供内部使用,看楼下:

    诗语
    管理员
    • 文章数量: 5,942
    发帖数:9997
    楼主
    @feibisi
    
    root@114.215.154.53's password: 
    Last login: Tue May  3 00:59:24 2016 from 1.81.135.116
    
    Welcome to aliyun Elastic Compute Service!
    
    [root@weixiaoduo-sx-nginx-all-01 ~]# service nginx start
    Starting nginx...  done
    [root@weixiaoduo-sx-nginx-all-01 ~]# df -TH
    Filesystem     Type   Size  Used Avail Use% Mounted on
    /dev/xvda1     ext4    22G  2.7G   18G  14% /
    tmpfs          tmpfs  2.1G     0  2.1G   0% /dev/shm
    /dev/xvdb1     ext3    11G   11G     0 100% /data
    [root@weixiaoduo-sx-nginx-all-01 ~]#  umount /mnt/data
    umount: /mnt/data: not found
    [root@weixiaoduo-sx-nginx-all-01 ~]# umount /data
    umount: /data: device is busy.
            (In some cases useful info about processes that use
             the device is found by lsof(8) or fuser(1))
    [root@weixiaoduo-sx-nginx-all-01 ~]# fuser -km /data
    /data:                1142  1147c  1339  1340  1364  1406cm
    [root@weixiaoduo-sx-nginx-all-01 ~]# umount /data
    [root@weixiaoduo-sx-nginx-all-01 ~]# fdisk /dev/xvdb
    
    WARNING: GPT (GUID Partition Table) detected on '/dev/xvdb'! The util fdisk doesn't support GPT. Use GNU Parted.
    
    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): d
    Selected partition 1
    
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-6501, default 1): 
    Using default value 1
    Last cylinder, +cylinders or +size{K,M,G} (1-6501, default 6501): 
    Using default value 6501
    
    Command (m for help): wp
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@weixiaoduo-sx-nginx-all-01 ~]# e2fsck -f /dev/xvdb1
    e2fsck 1.41.12 (17-May-2010)
    第一步: 检查 inode, 块, 和大小
    resize2fs /dev/xvdb1
    第二步: 检查目录结构
    第 3 步: 检查目录连接性
    /lost+found 未找到. 创建<y>? 是
    
    Pass 4: Checking reference counts
    第 5 步: 检查簇概要信息
    
    /dev/xvdb1: ***** 文件系统已修改 *****
    /dev/xvdb1: 191435/655360 files (3.2% non-contiguous), 2559280/2620792 blocks
    [root@weixiaoduo-sx-nginx-all-01 ~]# /dev/xvdb1
    -bash: /dev/xvdb1: 权限不够
    [root@weixiaoduo-sx-nginx-all-01 ~]# resize2fs /dev/xvdb1
    resize2fs 1.41.12 (17-May-2010)
    Resizing the filesystem on /dev/xvdb1 to 13106008 (4k) blocks.
    The filesystem on /dev/xvdb1 is now 13106008 blocks long.
    
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdb1 /mnt/dev1
    mount: mount point /mnt/dev1 does not exist
    [root@weixiaoduo-sx-nginx-all-01 ~]# df -TH
    Filesystem     Type   Size  Used Avail Use% Mounted on
    /dev/xvda1     ext4    22G  2.7G   18G  14% /
    tmpfs          tmpfs  2.1G     0  2.1G   0% /dev/shm
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdb1 /mnt/data
    mount: mount point /mnt/data does not exist
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/data /mnt/data
    mount: you must specify the filesystem type
    [root@weixiaoduo-sx-nginx-all-01 ~]# df -TH
    Filesystem     Type   Size  Used Avail Use% Mounted on
    /dev/xvda1     ext4    22G  2.7G   18G  14% /
    tmpfs          tmpfs  2.1G     0  2.1G   0% /dev/shm
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdv1 /data
    mount: you must specify the filesystem type
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdv1 /mnt/dev1
    mount: you must specify the filesystem type
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdb1 /mnt/dev1
    mount: mount point /mnt/dev1 does not exist
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdb /mnt/dev1
    mount: you must specify the filesystem type
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdb /mnt/data
    mount: you must specify the filesystem type
    [root@weixiaoduo-sx-nginx-all-01 ~]# mount /dev/xvdb1 /data
    [root@weixiaoduo-sx-nginx-all-01 ~]# df -TH
    Filesystem     Type   Size  Used Avail Use% Mounted on
    /dev/xvda1     ext4    22G  2.7G   18G  14% /
    tmpfs          tmpfs  2.1G     0  2.1G   0% /dev/shm
    /dev/xvdb1     ext3    53G   11G   40G  21% /data
    [root@weixiaoduo-sx-nginx-all-01 ~]# 
    Broadcast message from root@weixiaoduo-sx-nginx-all-01
    	(unknown) at 1:22 ...
    
    The system is going down for power off NOW!
    Connection to 114.215.154.53 closed by remote host.
    Connection to 114.215.154.53 closed.
    
    [进程已完成]
    
    诗语
    管理员
    • 文章数量: 5,942
    发帖数:9997
    楼主
    @feibisi

    Welcome to aliyun Elastic Compute Service!

    [root@weixiaoduo-sx-nginx-all-01 ~]# service nginx restart
    Stoping nginx… done
    Starting nginx… done

    参考资料:

    https://help.aliyun.com/knowledge_detail/6504571.html

    https://help.aliyun.com/document_detail/ecs/operation-guide/disk-operation/resize-linux.html

正在查看 3 个帖子:1-3 (共 3 个帖子)
  • 话题 「记一次服务器磁盘扩容,还好以前折腾过 Linux 命令行。」 已关闭,不接受新回复。

话题信息