Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ one of its maintained forks.
datadisk Cookbook
=================

This cookbook formats and mounts a second disk (datadisk) on the specified mountpoint. If you like living dangerously, you can try this with an existing dir by using ::existing_datadir, but that code is less polished (this is done in single user mode using rsync, which is somewhat finicky).
This cookbook formats and mounts a second disk (datadisk) on the specified mountpoint. If you like living dangerously, you can try this with an existing dir by using `::existing_datadir`, but that code is less polished (this is done in single user mode using rsync, which is somewhat finicky).

Requirements
------------
- a second disk following the format of /dev/[sx]v?d[a-z], e.g. /dev/sdb or /dev/xvde, containing a partition without filesystem
- a second disk following the format of `/dev/[sx]v?d[a-z]`, e.g. `/dev/sdb` or `/dev/xvde`, containing a partition without filesystem

for the ::existing_datadir recipe:
for the `::existing_datadir` recipe:
- an OS using upstart
- recent, working (believe is what you do in church!) backups (though tested and with several failsafes in place, this cookbook still does pretty scary stuff.)

Expand Down Expand Up @@ -76,8 +76,9 @@ Contributing
------------

e.g.

1. Fork the repository on Github
2. Create a named feature branch (like `add_component_x`)
2. Create a named feature branch (like `add_component_x`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
Expand Down
6 changes: 3 additions & 3 deletions providers/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def whyrun_supported?
partition = "#{disk}1"

execute "partition the disk" do
command "echo -e "n\np\n1\n\nw" | fdisk #{disk}"
not_if { File.exist?(partition) }
command "echo -e 'n\np\n1\n\n\nw\n' | fdisk #{disk}"
not_if { ::File.exist?(partition) }
end

execute "format the disk" do
command "mkfs -t ext3 #{partition}"
command "mkfs -t ext4 #{partition}"
not_if { disk.nil? || ::File.directory?("#{datadir}") }
end

Expand Down