【发布时间】:2014-10-20 04:51:27
【问题描述】:
我一直在关注关于在 GCE 中使用 MongoDB 的教程
http://docs.mongodb.org/ecosystem/platforms/google-compute-engine/
我为 MongoDB 存储创建了一个单独的 SSD 磁盘并将其附加到实例,但是当我尝试安全挂载时
sudo /usr/share/google/safe_format_and_mount \ -m "mkfs.ext4 -F -o defaults,auto,noatime,noexec" /dev/sdb /data
我收到此错误:
safe_format_and_mount: Running: fsck.ext4 -a /dev/sdb
safe_format_and_mount: fsck.ext4: Bad magic number in super-block while trying to open /dev/sdb
safe_format_and_mount: /dev/sdb:
safe_format_and_mount: The superblock could not be read or does not describe a correct ext2
safe_format_and_mount: filesystem. If the device is valid and it really contains an ext2
safe_format_and_mount: filesystem (and not swap or ufs or something else), then the superblock
safe_format_and_mount: is corrupt, and you might try running e2fsck with an alternate superblock:
safe_format_and_mount: e2fsck -b 8193 <device>
safe_format_and_mount:
safe_format_and_mount: Fsck could not correct errors on /dev/sdb
safe_format_and_mount: Running: mount -o discard,defaults /dev/sdb /data
safe_format_and_mount: mount: you must specify the filesystem type
/usr/share/google/safe_format_and_mount: line 83: file: command not found
safe_format_and_mount: Running: mkfs.ext4 -F -o defaults,auto,noatime,noexec /dev/sdb
safe_format_and_mount: mke2fs 1.42.5 (29-Jul-2012)
safe_format_and_mount: Discarding device blocks: done
safe_format_and_mount: mkfs.ext4: unknown os - defaults,auto,noatime,noexec
safe_format_and_mount: Format of /dev/sdb failed.
safe_format_and_mount: Running: mount -o discard,defaults /dev/sdb /data
safe_format_and_mount: mount: you must specify the filesystem type
safe_format_and_mount: Tried everything we could, but could not mount /dev/sdb.
但是当我删除默认值、auto、noatime、noexec 并只使用 mkfs.ext4 -F 时它可以工作。
但是如果我设置了 MongoDB 的 dbpath,MongoDB 服务器将无法启动。如果我们运行 MongoDB,它会给出坏扇区。
那么如何挂载额外的磁盘并使用 GCE 创建一个合适的 ext4 文件系统?
【问题讨论】:
标签: mongodb google-compute-engine