記一次伺服器磁碟擴容,還好以前折騰過 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 命令列。」 已關閉,不接受新回覆。

話題資訊