Comments (2)
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.
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)
- vagrant destroy leaves stale vbox media behind HOT 4
- can not setup persistent storage HOT 2
- Force delete vdi files on vagrant destroy
- Storage Mount Doesn't Work HOT 1
- VirtualBox Storage does not get removed from Virtual Media Manager
- conflicting dependencies childprocess (= 0.5.9) and childprocess (= 0.6.3) HOT 1
- Typo: volgroupname => part_type_code HOT 1
- use_lvm=true should default mount & format false HOT 1
- Encryption Support
- warning: constant ::Fixnum is deprecated HOT 2
- INFO: rcu_sched detected stalls on CPUs/tasks: HOT 2
- vagrant halt fails with hotplug error HOT 9
- Injected script not created properly, and disk not mounted HOT 1
- Disk space doesn't expand past 6-ish MB HOT 4
- Allow multiple persistent storages HOT 1
- Compatibility with VirtualBox 6.0 HOT 4
- /tmp/ cannot execute. HOT 5
- Timed out waiting for devices dev-persistent-persistent.device HOT 1
- Support disks larger than 2TB
- If location is relative consider it under machine's root directory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vagrant-persistent-storage.