我是Linux的新手,我只需使用命令将新的80GB磁盘装入我的VPS,只需10GB:
mkdir -p /mnt/vdb
mkfs.ext4 /dev/vdb
mount /dev/vdb /mnt/vdb
之后我尝试使用以下方法创建分区:
fdisk /dev/vdb
然后当我输入 lsblk
表明:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 10G 0 disk
└─vda1 253:1 0 10G 0 part /
vdb 253:16 0 50G 0 disk
└─vdb1 253:17 0 50G 0 part
和 fdisk -l
说明:
Disk /dev/vda: 10.7 GB, 10737418240 bytes
4 heads, 32 sectors/track, 163840 cylinders, total 20971520 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 identifier: 0x00096ccc
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 20971519 10484736 83 Linux
Disk /dev/vdb: 53.7 GB, 53687091200 bytes
7 heads, 22 sectors/track, 680893 cylinders, total 104857600 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 identifier: 0x9c319ee4
Device Boot Start End Blocks Id System
/dev/vdb1 2048 104857599 52427776 83 Linux
但 df -h
没有显示我的新卷:
Filesystem Size Used Avail Use% Mounted on
udev 972M 12K 972M 1% /dev
tmpfs 196M 384K 196M 1% /run
/dev/vda1 9.9G 1.5G 8.0G 16% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 977M 0 977M 0% /run/shm
none 100M 0 100M 0% /run/user
我只是按照谷歌搜索的所有教程继续尝试,但似乎我的总磁盘空间仍然是10GB。有什么帮助吗?
df -h
已经。我可以知道当我用完默认的10GB使用量时服务器会自动使用50GB磁盘吗?