on first boot or always?

if I understand correctly, root it doesn't mount atuomatically, but media
it does?

this is no AWS specific, but this is how i do it on my vm,

I have an script, that check if there is metadata, is there is metadata,
then mounts
if NO metadata is found, format and then mount.

it does all these checks so you can run the scripts safely all the times
you want.

hope this helps.

replace sdc with the disk you want
/u02 with the mountpoint you need


blkid /dev/sdc*
if [ $? -ne 0 ]; then
   if [ -b /dev/sdc1 ]; then
     echo "ignoring sdc, partition found on /dev/sdc1"
   else
     echo "ok: no partition on /dev/sdc"
     parted -s /dev/sdc mklabel msdos
     parted -s /dev/sdc unit MB mkpart primary 0% 100%
     mkfs.ext4 /dev/sdc1
   fi
else
  echo "filesystem metadata found on sdc, ignoring"
fi


To mount, you can use something like this:

blkid /dev/sdc1*
if [ $? -eq 0 ]; then
  grep u02 /etc/fstab 2>/dev/null|| echo $(blkid /dev/sdc1 -o export | head
-n1) /u03 ext4 defaults 0 0 >> /etc/fstab
  mkdir -p /u03
  mountpoint /u03 || mount /u03
else
  echo "filesystem metadata not found on sdc1, ignoring"
fi





On Tue, Jul 15, 2014 at 6:33 PM, San <[email protected]> wrote:

> using block_device_mapping, I can easily add EBS storage to the instance(s)
> like this:
>
>
> ec2.block_device_mapping = [
>>
>>     {
>>       'DeviceName'              => "/dev/sda1",
>>       'VirtualName'             => 'root',
>>       'Ebs.VolumeSize'          => 30,
>>       'Ebs.DeleteOnTermination' => true
>>      },
>>      {
>>        'DeviceName'              => '/dev/sdf',
>>        'VirtualName'             => 'media',
>>        'Ebs.VolumeSize'          => 100,
>>        'Ebs.DeleteOnTermination' => true
>>      }
>> ]
>
>
> but like root, it doesn't mount   the extra volume automatically. So
> pretty much useless until I login to the node, create a file system and
> mount it manually. Is there a [vagrant] way to automate this? Or how can I
> do this?
>
> Best!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to