[geeks] linux - lvm - fdisk

Brian Dunbar brian.dunbar at gmail.com
Thu May 15 16:04:39 CDT 2014


I appear to have been confused.

One - one does not appear to need to format the drive as directed - just
create the group, create the volume and go.

Two - Ansible might have a flaw in it's LVM module.

I can create, manually, the volume group, and extend it, when I run it 'by
hand' on the server.

$ vgcreate vgpool /dev/xvdf
$ vgextend vgpool /dev/xvdg /dev/xvdh
$ vgdisplay
(snip)
VG Size    3.00 TiB


When I feed the parameters to ansible like so

lvg: vg="{{ nfs_2_lvm_name }}" pesize="{{ nfs_2_lvm_pesize }}"
pvs=/dev/xvdf,/dev/xvdg,/dev/xvdh vg_options="" state=present

It looks sick and reports ..

Unable to add physical volume '/dev/xvdf /dev/xvdg /dev/xvdh' to volume
group 'vgpool'

Whatever, Ansible. I'll throw this crap in a command statement and get this
thing done.






On Thu, May 15, 2014 at 3:35 PM, Anthony Ortenzi <geeks at litfire.com> wrote:

> Except the device is the lv name, no?
>
> 1) create volume group on EBS devices
> 2) create lv on volume group
> 3) create file system on lv
> 4) mount file system
>  On May 15, 2014 4:26 PM, "Brian Dunbar" <brian.dunbar at gmail.com> wrote:
>
> > Right! I'm think I need to use filesystem like so ..
> >
> > - name: ebsx volume format
> >   filesystem:
> >     dev: /dev/xvdf
> >     fstype: ext4
> >     opts: "something goes here"
> >
> > ref: http://docs.ansible.com/filesystem_module.html
> >
> > I might be guilty of overthinking this whole thing.
> >
> >
> >
> >
> >
> >
> > On Thu, May 15, 2014 at 2:54 PM, Anthony Ortenzi <geeks at litfire.com>
> > wrote:
> >
> > > Or perhaps lvol, lvg, filesystem, and mount?
> > >
> > > http://docs.ansible.com/lvg_module.html
> > > http://docs.ansible.com/lvol_module.html
> > > http://docs.ansible.com/mount_module.html
> > > http://docs.ansible.com/filesystem_module.html
> > >
> > >
> > >
> > > On Thu, May 15, 2014 at 3:32 PM, Brian Dunbar <brian.dunbar at gmail.com
> > > >wrote:
> > >
> > > > Haw.  I'm using Ansible.
> > > >
> > > > I don't object to learning a new tool but it's overkill for this
> > > use-case:
> > > > be quicker to just insert a step like "login to the host and execute
> > > fdisk"
> > > >
> > > >
> > > > On Thu, May 15, 2014 at 2:22 PM, Anthony Ortenzi <geeks at litfire.com>
> > > > wrote:
> > > >
> > > > > Isn't AWS Opsworks just Chef? Someone must have made a chef recipe
> > for
> > > > > this.
> > > > > On May 15, 2014 2:38 PM, "Brian Dunbar" <brian.dunbar at gmail.com>
> > > wrote:
> > > > >
> > > > > > My goal is to use an EC2 instance (Ubuntu) and mount from two to
> > four
> > > > EBS
> > > > > > volumes as a single mount point.
> > > > > >
> > > > > > The driver is that size limit on an EBS volume is 1024mb, and we
> > have
> > > > > more
> > > > > > data to store than that.
> > > > > >
> > > > > > (Long range plans are to use S3 as a store for this data, but
> > that's
> > > > 'in
> > > > > > the future')
> > > > > >
> > > > > > What I envision is provisioning a host, use LVM to setup a volume
> > > > group,
> > > > > > containing two EBS volumes, for a 2tb 'disk'.  As needed, I
> create
> > a
> > > > new
> > > > > > volume, add it to the instance, then the VG.
> > > > > >
> > > > > > How-tos [1] indicate one needs to format the drive first, using
> > > fdisk,
> > > > > set
> > > > > > partition type to 8e (Linux LVM).
> > > > > >
> > > > > > Okay, I can do that, but I'd really prefer to script it.
> > > > > >
> > > > > >
> > > > > > [1] example
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/
> > > > > >
> > > > > >
> > > > > > On Thu, May 15, 2014 at 1:22 PM, Mark Benson <
> md.benson at gmail.com>
> > > > > wrote:
> > > > > >
> > > > > > > On 15 May 2014, at 18:44, Brian Dunbar <brian.dunbar at gmail.com
> >
> > > > wrote:
> > > > > > >
> > > > > > > > Lame question re: LVM. I want to use mkfs.ext3 to format the
> > disk
> > > > > > _with_
> > > > > > > > partition type 8e (lvm).  I.e. have it 'happen' by script,
> vice
> > > > > running
> > > > > > > > fdisk manually.
> > > > > > > >
> > > > > > > > Can this be done?  man seems to say 'yes' but is short on
> bold
> > > text
> > > > > > > saying
> > > > > > > > 'type this in, dummy'
> > > > > > >
> > > > > > > I'm not quite sure what your trying to achieve here, so I'm not
> > > > sure...
> > > > > > >
> > > > > > > LVM, as I understand it, exists above the base partition
> scheme,
> > > with
> > > > > > > partitions being used as physical volumes into which you add
> > volume
> > > > > > groups
> > > > > > > and
> > > > > > > logical volumes. I had to get my head around this to use Xen
> VMs
> > > on a
> > > > > > > debian
> > > > > > > server, but I'm by no means an expert.
> > > > > > >
> > > > > > > I don't know, are you trying to format a bare metal drive to
> > > contain
> > > > a
> > > > > > > single
> > > > > > > a LVM ext3 logical volume?
> > > > > > > Or, are you trying to remove the LVM junk and format the drive
> > > with a
> > > > > > > single
> > > > > > > common-or-garden ext 3 partition?
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > Mark Benson
> > > > > > >
> > > > > > > http://DECtec.info
> > > > > > > Twitter: @DECtecInfo
> > > > > > > HECnet: STAR69::MARK
> > > > > > >
> > > > > > > Online Resource & Mailing List for DEC Enthusiasts.
> > > > > > > _______________________________________________
> > > > > > > GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Brian Dunbar
> > > > > >
> > > > > > "Display some adaptability"
> > > > > > _______________________________________________
> > > > > > GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
> > > > > _______________________________________________
> > > > > GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Brian Dunbar
> > > >
> > > > "Display some adaptability"
> > > > _______________________________________________
> > > > GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
> > > _______________________________________________
> > > GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
> > >
> >
> >
> >
> > --
> > Brian Dunbar
> >
> > "Display some adaptability"
> > _______________________________________________
> > GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
> _______________________________________________
> GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks
>



-- 
Brian Dunbar

"Display some adaptability"


More information about the geeks mailing list