zoukankan      html  css  js  c++  java
  • Linux系统数据盘在线扩容

    1、卸载数据盘

    [root@localhost ~]# umount /dev/sdb1

    2、使用fdisk /dev/sdb 对数据盘分区操作

    [root@localhost ~]# fdisk /dev/sdb
    
    WARNING: The size of this disk is 3.0 TB (3000034656256 bytes).
    DOS partition table format can not be used on drives for volumes
    larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID 
    partition table format (GPT).
    
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    
    Command (m for help): p
    
    Disk /dev/sdb: 3000.0 GB, 3000034656256 bytes, 5859442688 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x000b6f25
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2048  1048578047   524288000   83  Linux
    
    Command (m for help): d
    Selected partition 1
    Partition 1 is deleted
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): 
    Using default response p
    Partition number (1-4, default 1): 
    First sector (2048-4294967295, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-4294967294, default 4294967294): +1300G
    Partition 1 of type Linux and of size 1.3 TiB is set
    
    Command (m for help): p
    
    Disk /dev/sdb: 3000.0 GB, 3000034656256 bytes, 5859442688 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x000b6f25
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2048  2726299647  1363148800   83  Linux
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.

    3、检查文件系统

    [root@localhost ~]# e2fsck -f /dev/sdb1
    e2fsck 1.42.9 (28-Dec-2013)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /dev/sdb1: 13/32768000 files (0.0% non-contiguous), 3714898/131072000 blocks

    4、变更文件系统大小

    [root@localhost ~]# resize2fs /dev/sdb1
    resize2fs 1.42.9 (28-Dec-2013)
    Resizing the filesystem on /dev/sdb1 to 340787200 (4k) blocks.
    The filesystem on /dev/sdb1 is now 340787200 blocks long.

    5、重新挂载

    [root@localhost ~]# mount -a
    [root@localhost ~]# df -Th
    Filesystem     Type      Size  Used Avail Use% Mounted on
    /dev/sda2      ext4       99G  3.5G   90G   4% /
    devtmpfs       devtmpfs   16G     0   16G   0% /dev
    tmpfs          tmpfs      16G     0   16G   0% /dev/shm
    tmpfs          tmpfs      16G  9.2M   16G   1% /run
    tmpfs          tmpfs      16G     0   16G   0% /sys/fs/cgroup
    /dev/sda1      ext4      477M  122M  326M  28% /boot
    /dev/sda5      ext4      142G  942M  134G   1% /var
    tmpfs          tmpfs     3.2G   16K  3.2G   1% /run/user/0
    /dev/loop0     iso9660   4.1G  4.1G     0 100% /mnt
    /dev/sdb1      ext4      1.3T  6.2G  1.2T   1% /storage
  • 相关阅读:
    洛谷P3122 [USACO15FEB]圈住牛Fencing the Herd(计算几何+CDQ分治)
    洛谷P4502 [ZJOI2018]保镖(计算几何+三维凸包)
    [Codeforces1137D]Cooperative Game
    洛谷P2287 [HNOI2004]最佳包裹(三维凸包)
    洛谷P4724 【模板】三维凸包
    洛谷P4526 【模板】自适应辛普森法2(Simpson法)
    A + B Problem
    Java中方法next()和nextLine()的区别
    发现环
    分考场
  • 原文地址:https://www.cnblogs.com/chengtai/p/7389284.html
Copyright © 2011-2022 走看看