扩容有挂载和LVM的不同方式。LVM更好,但是复杂一些,本次使用简单的挂载磁盘扩容。
查看磁盘
fdisk -l
我加了3TB的空间
Disk /dev/sdc: 3298.5 GB, 3298534883328 bytes, 6442450944 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
初始化分区
fdisk /dev/sdc
[root@os111 ~]# fdisk /dev/sdc
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.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x4361a5cd.
WARNING: The size of this disk is 2.2 TB (2199023255552 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).
Command (m for help): p
Disk /dev/sdc: 2199.0 GB, 2199023255552 bytes, 4294967296 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: 0x4361a5cd
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-4294967295, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-4294967294, default 4294967294):
Using default value 4294967294
Partition 1 of type Linux and of size 2 TiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@site104 ~]#
格式化文件系统
mkfs -t xfs /dev/sdc1
挂载
vi /etc/fstab
/dev/sdc1 /workspace xfs defaults 0 0
重启
df -h