我在创建Centos AWS实例时请求了20 GB的根文件系统。根文件系统是在8 GB“分区”上创建的,名为/ dev / xvde。对我来说,这看起来像是整个磁盘的名称,而不是分区。
使用剩余磁盘空间创建/ dev / xvde2分区是否“安全”?
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvde 7.8G 5.6G 1.9G 76% /
tmpfs 3.6G 0 3.6G 0% /dev/shm
# fdisk -l
Disk /dev/xvde: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Fdisk让它看起来没有分区
[root@ip-10-225-129-153 ~]# sudo fdisk /dev/xvde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x3be2cd6e.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): c
DOS Compatibility flag is not set
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/xvde: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 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: 0x3be2cd6e
Device Boot Start End Blocks Id System
Command (m for help): q
#
Parted显示一个20 GB的循环设备
# sudo parted
GNU Parted 2.1
Using /dev/xvde
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvde: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 21.5GB 21.5GB ext4
(parted)
答案 0 :(得分:2)
不,我想不是。如果我是正确的,编写分区表将破坏您的文件系统。
我认为你的磁盘没有被分区,即不包含分区表(请参阅有关'无效标记'的警告,以及它安装的/dev/xvde
的事实不是/dev/xvde1
)。检查/proc/partitions
以确定。
我认为发生的事情是你有一个简单的块设备(没有分区表),但文件系统的创建小于分区。所以你只需要扩展文件系统。 resize2fs
将为ext2,ext3和ext4执行此操作。现代内核将允许在线调整ext3和ext4的大小。传递无大小参数将使其调整为允许的完整大小。
答案 1 :(得分:1)
到目前为止,一切看起来都很好。 我更喜欢我的启动盘是/ dev / xvda而不是/ dev / xvde,但我现在要使用/ dev / xvde。也许它与某些事情有关/ dev / sdX - / dev / xvdX转换?