I'm switching back and forth between two tutorials for mounting the EBS volume and I have an issue. I'd rather make sure that I'm doing it right, rather than somehow compromise my instance (especially since I haven't created an AMI yet...).

I've attached the EBS at /dev/sda1. In the respective tutorials, it's mounted at dev/sdh. I assumed that wasn't a big deal at all.

I just changed the initial command to create the filesystem to:

  mkfs.xfs /dev/sda1

I received the following message:

 mkfs.xfs: /dev/sda contains a mounted filesystem
 (....) <devicename> is required unless -d name=xxx is given. 

Per one of the tutorials that doesn't seem like the correct response. Can I just go ahead with the following series of linux commands and be fine?

    grep -q xfs /proc/filesystems || sudo modprobe xfs
    sudo mkfs.xfs /dev/sda1

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

1 Answer 1


It sounds like you are running off of an EBS backed instance. In this case, the root file store is mounted to /dev/sda1, so you really DO NOT want to overwrite this.

If you are running off of instance store then it may have an ext3 filesystem in place already. The best way to resolve this is to attach the drive to /dev/sdg to avoid confusion. That way, if it does give you a warning, it will be OK to blow it away.

TL;DR Attach the drive to /dev/sdg or later in the alphabet, then format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.