Giter VIP home page Giter VIP logo

Comments (2)

rsenden avatar rsenden commented on May 30, 2024

I have now updated my copy of manage_storage.rb as follows. This uses /bin/sh instead of /bin/bash, fdisk instead sfdisk, and an approach similar to boot2docker to create the filesystem if it does not yet exist. I removed all the lvm stuff for now, as this is not supported on boot2docker. I also do not check the format flag; I format unconditionally if the filesystem does not yet exist.

        disk_operations_template = ERB.new <<-EOF
#!/bin/sh
# fdisk the disk if it's not a block device already:
PERSISTENT_DATA=`blkid -o device -l -t LABEL=#{mnt_name}`
if [ ! -n "$PERSISTENT_DATA" ]; then
    echo "Unformatted persistent data disk found; creating partition" >> /tmp/disk_operation_log.txt 2>&1
    (echo n; echo p; echo 1; echo ; echo ; echo w) | fdisk #{disk_dev} >> /tmp/disk_operation_log.txt 2>&1
    echo "Running modprobe" >> /tmp/disk_operation_log.txt 2>&1
    modprobe >> /tmp/disk_operation_log.txt 2>&1
    echo "Creating filesystem" >> /tmp/disk_operation_log.txt 2>&1
    mkfs.#{fs_type} #{disk_dev}1 -L #{mnt_name} >> /tmp/disk_operation_log.txt 2>&1
fi
<% if mount == true %>
echo "Creating mount point" >> /tmp/disk_operation_log.txt 2>&1
[ -d #{mnt_point} ] || mkdir -p #{mnt_point} >> /tmp/disk_operation_log.txt 2>&1
#echo "Updating fstab" >> /tmp/disk_operation_log.txt 2>&1
#[ "`grep -i #{disk_dev}1 /etc/fstab`" ] || echo #{disk_dev}1 #{mnt_point} #{fs_type} #{mnt_options.join(',')} 0 0 >> /etc/fstab
echo "Mounting #{mnt_point}" >> /tmp/disk_operation_log.txt 2>&1
echo "mount -t #{fs_type} -o #{mnt_options.join(',')} #{disk_dev}1 #{mnt_point}" >> /tmp/disk_operation_log.txt 2>&1
[ "`mount | grep #{mnt_point}`" ] || mount -t #{fs_type} -o #{mnt_options.join(',')} #{disk_dev}1 #{mnt_point} >> /tmp/disk_operation_log.txt 2>&1
echo "#{mnt_point} mounting returned:  $?" >> /tmp/disk_operation_log.txt 2>&1
<% end %>
exit $?
        EOF

from vagrant-persistent-storage.

mritalian avatar mritalian commented on May 30, 2024

Is there any intention to merge above change (or rather an updated version of that) into the codebase? Are so few people using boot2docker that this doesn't matter? I don't know Ruby or I'd work on this myself.

from vagrant-persistent-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.