joeduffy / blocker

A simple AWS EBS volume plugin for Docker
Apache License 2.0
82 stars 13 forks source link

Failed to mount the volume which already partitioned #10

Open mkeerth opened 6 years ago

mkeerth commented 6 years ago

I'm getting the below exception if i mount the volume which already partitioned.

docker: Error response from daemon: error while mounting volume '/': Mounting device /dev/sdf to /mnt/blocker/9f0d4465-8b44-4358-b1a9-deb009e9df2b failed: exit status 32 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.

Steps to reproduce.

STEP 1: Take a snapshot from EBS volume attached to EC2 instance STEP 2. Create new Volume from the snapshot STEP 3: Run this script with the volume id docker run -d --volume-driver blocker -v VOULUE_ID:/data nginx

If we have a partition in volume we should mount /dev/xvdf1 instead of /dev/xvdf.

If you could update the code to mount a volume from snapshot id that will be great.