Discussion Forums



Thread: AWS - EC2 - File System Questions

This question is answered.

Welcome, Guest Help
Login Login


Permlink Replies: 24 - Pages: 2 [ Previous | 1 2 ] - Last Post: Feb 10, 2008 7:40 PM by: PersistentFS.com
Peter M. Abraham
RealName(TM)

Posts: 10
Registered: 1/28/08
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 3, 2008 8:07 PM PST   in response to: Eric Hammond
 
  Click to reply to this thread Reply

Greetings Eric:

Thank you.  This worked, and did the trick.

Thank you for your time and help.



spuser

Posts: 24
Registered: 1/11/08
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 6, 2008 9:54 PM PST   in response to: Eric Hammond
 
  Click to reply to this thread Reply

Hi,

Is it possible to create lvm on an instance, create an ami from that instance and then get the logical volumes mounted when launching another instance from that ami.

I first created a lvm on an extra large instance (amazon's fedora 6 public ami) as follows:

umount /mnt
pvcreate /dev/sdb /dev/sdc /dev/sdd /dev/sde
vgcreate vgall /dev/sdb /dev/sdc /dev/sdd /dev/sde
lvcreate -L 100g -n vol1 vgall
lvcreate -L 900g -n vol2 vgall
yes | mkfs -t ext3 /dev/vga/vol1
yes | mkfs -t ext3 /dev/vga/vol2

I changed /etc/fstab as follows:

/dev/sda1 /     ext3    defaults 1 1
/dev/vgall/vol1  /tmp  ext3    defaults 0 0
/dev/vgall/vol2  /mnt  ext3    defaults 0 0
none      /proc proc    defaults 0 0
none      /sys  sysfs   defaults 0 0

When I rebooted the same instance, on reboot the logical volumes got mounted without any problem. I did not add the following lines to any startup script.

dmsetup mknodes
vgscan --ignorelockingfailure
vgchange -ay --ignorelockingfailure
mount -a

I then created an ami from this instance by specifying the fstab path as /etc/fstab and terminated the instance. Then I launched a new instance from the ami but on this instance the logical volumes did not mount though /etc/fstab remains the same

/dev/sda1 /     ext3    defaults 1 1
/dev/vgall/vol1  /tmp  ext3    defaults 0 0
/dev/vgall/vol2  /mnt  ext3    defaults 0 0
none      /proc proc    defaults 0 0
none      /sys  sysfs   defaults 0 0

output of df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.9G  1.3G  8.1G  14% /

output of vgscan

Reading all physical volumes.  This may take a while...
No volume groups found

output of ls /etc/lvm/archive/

vgall_00000.vg  vgall_00001.vg  vgall_00002.vg

Thanks!





Eric Hammond
RealName(TM)


Posts: 1,134
Registered: 7/7/07
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 7, 2008 3:39 AM PST   in response to: spuser
Correct
  Click to reply to this thread Reply

spuser wrote:

Is it possible to create lvm on an instance, create an ami from that instance and then get the logical volumes mounted when launching another instance from that ami.


I think the short answer is "no".

The "ephemeral storage" content and structure is not saved with the AMI, though it does survive reboots.

You'll need to do the LVM setup on the first boot.

--
Eric Hammond
http://www.anvilon.com



Allen

Posts: 5,320
Registered: 3/19/07
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 7, 2008 5:11 AM PST   in response to: spuser
 
  Click to reply to this thread Reply

> Is it possible to create lvm on an instance, create an ami from thatinstance and then get the logical volumes mounted when launchinganother instance from that ami.

You can do this with a PersistentFS file system, http://www.PersistentFS.com , although note that while the PersistentFS file system can be mounted on a different instance, it cannot be mounted read-write on two instances simultaneously.



M. Garnaat
RealName(TM)


Posts: 2,027
Registered: 3/15/06
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 7, 2008 5:59 AM PST   in response to: Eric Hammond
 
  Click to reply to this thread Reply

I do this currently using a set of scripts that run upon instance startup.  So, basically, I have modified rc.local in the image and it now calls some scripts (that actually can be downloaded from S3 at startup time) and one of those scripts does all of the LVM stuff.

So, Eric is right in that you can't just do the LVM stuff and bundle the image and have it survive but there are ways to have the LVM happen automatically when an instance starts up.  The biggest downside is that it takes some time to do the LVM configuration.

Mitch


Yejun Yang
RealName(TM)


Posts: 173
Registered: 1/22/08
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 7, 2008 1:04 PM PST   in response to: M. Garnaat
 
  Click to reply to this thread Reply

And don't forget erasing itself at very end.



spuser

Posts: 24
Registered: 1/11/08
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 7, 2008 8:29 PM PST   in response to: Allen
 
  Click to reply to this thread Reply

Hi,

Is anyone using PersistentFS on an extra large instance. The limitation section under release notes on PersistentFS website indicates that it has not been tested on 64 bit instances.

Thanks!

PersistentFS.com

Posts: 128
Registered: 7/10/07
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 8, 2008 9:32 AM PST   in response to: spuser
 
  Click to reply to this thread Reply

The current Technology Preview Release of PersistentFS was compiled for 32-bit Linux and was tested on a small (32-bit) EC2 instance.  This release may or may not work on large and x-large (64-bit) instances.  At some point in the near future, 64-bit Linux will be a supported configuration.

Thank you for your interest in PersistentFS, and if you have any additional questions, we would be happy to try to answer them.



PersistentFS.com

Posts: 128
Registered: 7/10/07
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 8, 2008 3:09 PM PST   in response to: PersistentFS.com
 
  Click to reply to this thread Reply

P.S.  PersistentFS runs in user space using the FUSE (File System in User Space) interface.  The author of FUSE informs us that he regularly runs 32-bit file system executables under 64-bit Linux, so based on this information, the current release of PersistentFS should run unchanged on a large or x-large instance.  PersistentFS is dynamically linked to libfuse.so, and you have to copy the 32-bit libfuse.so over from a 32-bit machine, or compile it on the 64-bit machine using the -m32 option, i.e.:

   cd fuse-2.7.2
   ./configure CC="gcc -m32"
   make

Again, this will be a supported configuration in the near future.  In the meantime, if you try it and run into any difficulties, please let us know.

Thank you,

The PersistentFS Team
http://www.PersistentFS.com



PersistentFS.com

Posts: 128
Registered: 7/10/07
Re: Using LVM to split /dev/sda2 (/mnt) into multiple logical volumes
Posted: Feb 10, 2008 7:37 PM PST   in response to: PersistentFS.com
 
  Click to reply to this thread Reply

We tested PersistentFS on a 64-bit EC2 instance and confirmed that it works.  We updated our web site to include installation instructions.  If you run into any problems, or have any questions, please do not hesitate to contact us.

Thank you,

PersistentFS.com
http://www.PersistentFS.com


Point your RSS reader here for a feed of the latest messages in all forums