加入EBS到Ubuntu EC2实例 [英] Add EBS to Ubuntu EC2 Instance

查看:301
本文介绍了加入EBS到Ubuntu EC2实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题,连接EBS卷到我的Ubuntu EC2实例。

下面是我所做的:

  1. 从亚马逊AWS控制台,我创建了一个EBS 150GB容量和连接到一个Ubuntu 11.10 EC2实例。根据EBS卷属性,附件表示:​​[我的Ubuntu实例ID]是:/ dev / SDF(附后)

  2. 尝试安装在Ubuntu中的驱动器,并告诉我:安装是:/ dev / SDF不是块设备

    须藤设置/ dev / SDF /体积

  3. 于是我问过FDISK,并试图从新位置安装,并告诉我这是不正确的文件系统。

    须藤的fdisk -l <​​/ code>

    sudo的安装-v -t ext4的的/ dev / xvdf /体积

    错误:

      

    挂载:错误的财政司司长类型,坏的选择,在/ dev / xvdf坏的超级块,丢失   codePAGE或辅助程序,或在某些情况下有用的信息其他错误   发现在系统日志 - 尝试dmesg得到|尾左右。

    dmesg的|尾告诉我,这给了以下错误:

      

    EXT4-FS(SDA1):VFS:找不到的ext4文件系统

我也试过把配置到/ etc / fstab文件上的说明<一href="http://www.webmastersessions.com/how-to-attach-ebs-volume-to-amazon-ec2-instance">http://www.webmastersessions.com/how-to-attach-ebs-volume-to-amazon-ec2-instance,但还是给了相同的不正确的文件系统错误。

问题:

Q1:基于1点(上图),为什么卷映射到开发/自卫队时,它的真正映射到为/ dev / xvdf

Q2:还有什么我需要做的就是在EBS卷装的?我认为这只会照顾一切对我来说,当我连接到一个实例。

解决方案

由于这是一个新卷,你需要使用的文件系统格式步骤1和2。所以在整个过程中的EBS卷(块设备)与样品装入点:

  1. 创建EBS卷。

  2. 附加EBS卷的/ dev / SDF (EC2的针对特定设备的外部名)。

  3. 格式文件系统的/ dev / xvdf (这个特定的设备编号Ubuntu的内部名称):

     须藤对mkfs.ext4的/ dev / xvdf
     

    只有格式化文件系统,如果这是一个新的体积上没有数据。格式化将很难或者不可能恢复,这是此卷上previously任何数据。

  4. 挂载文件系统(带有更新/ etc / fstab文件,使其保持安装在重新启动):

     须藤的mkdir -m 000 /卷
    回声的/ dev / xvdf /体积自动noatime的0 0|须藤发球-a / etc / fstab中
    须藤挂载/卷
     

I'm having problem connecting EBS volume to my Ubuntu EC2 Instance.

Here's what I did:

  1. From the Amazon AWS Console, I created a EBS 150GB volume and attached it to an Ubuntu 11.10 EC2 instance. Under the EBS volume properties, "Attachment" shows: "[my Ubuntu instance id]:/dev/sdf (attached)"

  2. Tried mounting the drive on the Ubuntu box, and it told me "mount: /dev/sdf is not a block device"

    sudo mount /dev/sdf /vol

  3. So I checked with fdisk and tried to mount from the new location and it told me it wasn't the right file system.

    sudo fdisk -l

    sudo mount -v -t ext4 /dev/xvdf /vol

    the error:

    mount: wrong fs type, bad option, bad superblock on /dev/xvdf, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so

    "dmesg | tail" told me it gave the following error:

    EXT4-fs (sda1): VFS: Can't find ext4 filesystem

I also tried putting the configurations into /etc/fstab file as instructed on http://www.webmastersessions.com/how-to-attach-ebs-volume-to-amazon-ec2-instance, but still gave same not the right file system error.

Questions:

Q1: Based on point 1 (above), why was the volume mapped to 'dev/sdf' when it's really mapped to '/dev/xvdf'?

Q2: What else do I need to do to get the EBS volume loaded? I thought it'll just take care of everything for me when I attach it to a instance.

解决方案

Since this is a new volume, you need to format the EBS volume (block device) with a file system between step 1 and step 2. So the entire process with your sample mount point is:

  1. Create EBS volume.

  2. Attach EBS volume to /dev/sdf (EC2's external name for this particular device number).

  3. Format file system /dev/xvdf (Ubuntu's internal name for this particular device number):

    sudo mkfs.ext4 /dev/xvdf
    

    Only format the file system if this is a new volume with no data on it. Formatting will make it difficult or impossible to retrieve any data that was on this volume previously.

  4. Mount file system (with update to /etc/fstab so it stays mounted on reboot):

    sudo mkdir -m 000 /vol
    echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
    sudo mount /vol
    

这篇关于加入EBS到Ubuntu EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆