我有一个小型VPS(Centos 7),目前正在开发中,想要发布一些网站。
想要对磁盘的一部分进行分区,以便我可以放置/var/tmp
,/tmp
以便我可以noexec
按照建议应用 和其他规则。其输出fdisk -l
如下:
[root@vps59119 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental
phase. Use at your own discretion.
Disk /dev/ploop20162: 53.7 GB, 53687091200 bytes, 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 label type: gpt
Disk identifier: 86EB4992-47F0-42D4-98BB-81D8A91A0DFB
# Start End Size Type Name
1 2048 104855552 50G Linux filesyste
的输出df -h | grep ^/dev
如下:
[root@vps59119 ~]# df -h | grep ^/dev
/dev/ploop20162p1 50G 901M 47G 2% /
/
据我了解,我的PV 下只有 1 个大磁盘分区 ( )/dev/ploop20162p1
当我尝试对该空间进行分区并执行fdisk /dev/ploop20162p1
并创建新分区时,出现以下错误。
[root@vps59119 ~]# fdisk /dev/ploop20162p1
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 0xfabde285.
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-104853504, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104853504, default 104853504): +5G
Partition 1 of type Linux and of size 5 GiB is set
Command (m for help): w
fdisk: cannot write disk label: Bad file descriptor