Created
May 5, 2013 04:16
-
-
Save jlxw/5519672 to your computer and use it in GitHub Desktop.
Gives you commands to replicate the structure of LVM volumes on 1 machine on another.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/env ruby | |
require 'pp' | |
`lvscan`.gsub(/[\[\]']/,'').split("\n").each do |device_line| | |
device_line = device_line.split | |
vg, lv = device_line[1].split('/')[-2,2] | |
puts "lvcreate -L #{device_line[2].to_f}#{device_line[3][0,1]} -n #{lv} #{vg}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment