这就是问题:
root@ip-10-126-247-82:~# mkfs.ext4 /dev/xvda3 mke2fs 1.41.14 (22-Dec-2010) /dev/xvda3 is mounted; will not make a filesystem here!
这是调试:
root@ip-10-126-247-82:~# mount /dev/xvda1 on / type ext4 (rw) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,nodev) fusectl on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,size=10%,mode=0755) none on /run/lock type tmpfs (rw,nodev,size=5242880) none on /run/shm type tmpfs (rw,nodev)
设备/ dev / xvda2内核将重新格式化,xvda1,xvda2,xvda3是不同的设备
root@ip-10-126-247-82:~# ls -la /dev/xvda* brw-rw---- 1 root disk 202,1 2011-12-21 18:54 /dev/xvda1 brw-rw---- 1 root disk 202,2 2011-12-22 10:33 /dev/xvda2 brw-rw---- 1 root disk 202,3 2011-12-21 18:54 /dev/xvda3 root@ip-10-126-247-82:~# cat /proc/partitions major minor #blocks name 202 1 10485760 xvda1 202 2 356485632 xvda2 202 3 917504 xvda3
它不会格式化xvda1(正确)
root@ip-10-126-247-82:~# mkfs.ext4 /dev/xvda1 mke2fs 1.41.14 (22-Dec-2010) /dev/xvda1 is mounted; will not make a filesystem here!
它将格式化xvda2(正确)
root@ip-10-126-247-82:~# mkfs.ext4 /dev/xvda2 mke2fs 1.41.14 (22-Dec-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks,Stripe width=0 blocks 22282240 inodes,89121408 blocks 4456070 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 2720 block groups 32768 blocks per group,32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768,98304,163840,229376,294912,819200,884736,1605632,2654208,4096000,7962624,11239424,20480000,23887872,71663616,78675968 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 36 mounts or 180 days,whichever comes first. Use tune2fs -c or -i to override.
它不会格式化xvda3(不正确)
root@ip-10-126-247-82:~# mkfs.ext4 /dev/xvda3 mke2fs 1.41.14 (22-Dec-2010) /dev/xvda3 is mounted; will not make a filesystem here!
– 编辑:
添加lsof debug作为@Janne Pikkarainen建议:
root@ip-10-126-247-82:~# lsof -n | grep '202,3' root@ip-10-126-247-82:~# lsof -n | grep 'xvda3' root@ip-10-126-247-82:~#
似乎挂载点用于交换.
我相信我一直在研究m1.large,当时我正在研究仅附加了1 ephemeral storage的c1.medium.
root@ip-10-126-247-82:~# python Python 2.7.2+ (default,Oct 4 2011,20:03:08) [GCC 4.6.1] on linux2 Type "help","copyright","credits" or "license" for more information. >>> import boto.utils >>> boto.utils.get_instance_Metadata()['block-device-mapping'] {'ami': 'sda1','root': '/dev/sda1','ephemeral0': 'sda2','swap': 'sda3'}
这里的映射有点混淆(不知道为什么). sda – > xvda.从中你可以看到/映射到/ dev / xvda1,ephemeral0映射到/ dev / xvda2,swap映射到/ dev / xvda3.我相信交换空间由Xen管理,这就是我无法重新格式化/卸载它的原因.
我可以进一步证实这一点
root@ip-10-126-247-82:~# cat /proc/swaps Filename Type Size Used Priority /dev/xvda3 partition 917500 0 -1
但是现在我不确定是否正在使用swap,因为它没有出现在mount输出中.
– 编辑:
一般信息重新分级EC2,在c1.medium上你获得免费交换空间,在m1.large你没有.
通过“免费”我的意思是你可以卸载它,然后将其作为另一个短暂的存储,只是一个黑客:)回收它
swapoff -a mkfs.ext4 /dev/xvda3 mount /dev/xvda3 /mnt df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 9.9G 1.6G 7.8G 17% / udev 849M 4.0K 849M 1% /dev tmpfs 342M 172K 342M 1% /run none 5.0M 0 5.0M 0% /run/lock none 854M 0 854M 0% /run/shm /dev/xvda3 882M 17M 821M 3% /mnt