我正在尝试使用硬盘驱动器上的分区分配内存以用作 Amazon EC2 实例上的交换空间。我正在按照此处列出的说明进行操作
但是这样做会导致错误消息,并且不会创建分区。这是我的尝试:
sudo fdisk /dev/xvda1
Welcome to fdisk (util-linux 2.30.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The old xfs signature will be removed by a write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x59fc670b.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 2
First sector (2048-16773086, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-16773086, default 16773086): +4G
Created a new partition 2 of type 'Linux' and of size 4 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Invalid argument
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
问题是,重新启动后似乎没有应用beeb。并尝试设置交换区域失败:
mkswap /dev/xvda2
mkswap: cannot open /dev/xvda2: No such file or directory
任何人都知道为什么指南中列出的步骤在这种情况下不起作用?