All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] 2 LVM questions
@ 2001-07-20 13:34 moka
  2001-07-20 14:20 ` lembark
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: moka @ 2001-07-20 13:34 UTC (permalink / raw)
  To: linux-lvm

Hi there, new to LVM, so I would appreciate if you can 
point me to answers to these questions:

1) I have a system with 3 hard disks, and only one of 
them is presently used. This contains boot, root and 
swap plus a logical  partition(not LVM) containing
/var and /home.

I have big database tables, so I would like
 to create one volume group consisting of the 2
 unused disks plus the /var. Is this possible
 without losing what is in /var?
2) The reason I need  a lot of space is that mysql
  which I am using stores the database tables in /var.
 Can I somehow "name" the volume group /var
  so that mysql will not be confused?

Thanks in advance,
S.Alexiou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] 2 LVM questions
  2001-07-20 13:34 [linux-lvm] 2 LVM questions moka
@ 2001-07-20 14:20 ` lembark
  2001-07-20 14:28 ` Eric M. Hopper
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: lembark @ 2001-07-20 14:20 UTC (permalink / raw)
  To: linux-lvm


-- moka@hol.gr on 07/20/01 16:34:15 +0300

> 1) I have a system with 3 hard disks, and only one of 
> them is presently used. This contains boot, root and 
> swap plus a logical  partition(not LVM) containing
> /var and /home.
> 
> I have big database tables, so I would like
>  to create one volume group consisting of the 2
>  unused disks plus the /var. Is this possible
>  without losing what is in /var?
> 2) The reason I need  a lot of space is that mysql
>   which I am using stores the database tables in /var.
>  Can I somehow "name" the volume group /var
>   so that mysql will not be confused?


Leave the partitions you need in single user off of
LVM.  They may be necessary for fixing LVM at some
point (unless you enjoy booting from floppies).  In
general the contents of / (excluding /usr), /var and
primary swap are a good bet to keep off of LVM.

Creating the volume groups to hold this data will 
require blowing it off.  Simplest fix is to:

    Back the stuff up completely.
    Create two PV's from the 2 "extra" drives.
    Add the two PV'S into a single VG.
    Build your file systems (striping might
     be a useful idea or mirroring if you
     need the availability).
    Mount the new LV's under wherever the old
     partitions were mounted.
    Restore the data.

You probably aren't using all of "/var" for the 
MySQL database.  Whatever the directory you now
are using (e.g., /var/MySQL) can easily become
a mount point without the database even knowing 
about it.

sl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] 2 LVM questions
  2001-07-20 13:34 [linux-lvm] 2 LVM questions moka
  2001-07-20 14:20 ` lembark
@ 2001-07-20 14:28 ` Eric M. Hopper
  2001-07-20 14:38 ` Patrick Boutilier
  2001-07-20 15:34 ` Joe Thornber
  3 siblings, 0 replies; 5+ messages in thread
From: Eric M. Hopper @ 2001-07-20 14:28 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 2373 bytes --]

On Fri, Jul 20, 2001 at 04:34:15PM +0300, moka@hol.gr wrote:
> 
> Hi there, new to LVM, so I would appreciate if you can 
> point me to answers to these questions:
> 
> 1) I have a system with 3 hard disks, and only one of 
> them is presently used. This contains boot, root and 
> swap plus a logical  partition(not LVM) containing
> /var and /home.
> 
> I have big database tables, so I would like
>  to create one volume group consisting of the 2
>  unused disks plus the /var. Is this possible
>  without losing what is in /var?
> 2) The reason I need  a lot of space is that mysql
>   which I am using stores the database tables in /var.
>  Can I somehow "name" the volume group /var
>   so that mysql will not be confused?

	I would use pvcreate on your two disks, then vgcreate to bind
them together in a volume group.  A volume group is like a virtual disk
drive.  You have to 'partition' it.  This is what creating a 'logical'
volume us.  lvcreate is used for tihs.  You can create a logical volume
named whatever you want, but that name has nothing to do with where it's
mounted.

	Now, supposing you created a volume group called 'MyOnlyVG' and
created a logical volume on it called 'LVMvar', you now need to do a
mkfs on that logical volume.

mkfs /dev/MyOnlyVG/LVMvar

	After you do this, you should move the contents of /var to your
new filesystem.

mount /dev/MyOnlyVG/LVMvar /mnt/tmp
cp -ax /var /mnt/tmp

	Now, you can try using your new logical volume as '/var'.  I
think you can do this by going to single user mode then doing:

unmount /var
mount /dev/MyOnlyVG/LVMvar /var
init 3  # Goes back to multi-user mode.  init 5 for graphical login

	If everything seems to work fine, your new var should be OK.

	Now you can run pvcreate on your old /var device, run vgextend
to add it to the MyOnlyVG volume group, lvextend to resize the
/dev/MyOnlyVG/LVMvar logical volume/virtual partition, and a file system
resize utility to modifiy the size of the /var filesystem.

Have fun (if at all possible),
-- 
"It does me no injury for my neighbor to say there are twenty gods or no God.
It neither picks my pocket nor breaks my leg."  --- Thomas Jefferson
"Go to Heaven for the climate, Hell for the company."  -- Mark Twain
-- Eric Hopper (hopper@omnifarious.org  http://www.omnifarious.org/~hopper) --

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] 2 LVM questions
  2001-07-20 13:34 [linux-lvm] 2 LVM questions moka
  2001-07-20 14:20 ` lembark
  2001-07-20 14:28 ` Eric M. Hopper
@ 2001-07-20 14:38 ` Patrick Boutilier
  2001-07-20 15:34 ` Joe Thornber
  3 siblings, 0 replies; 5+ messages in thread
From: Patrick Boutilier @ 2001-07-20 14:38 UTC (permalink / raw)
  To: linux-lvm

What I would do is:

1. Create a Volume group using the 2 unused hard disks.
2. Create a file system on the new Logical volume
3. Copy your /var directory to the new filesystem mounted as /var2 
(shutdown Mysql first so the data is clean).
4. Move /var to /var3 (mv /var /var3)
5. Mount new file system as /var

When you are satisfied that everything is working on LVM fine you can 
then delete the partition that /var3 is on (old /var) and use it to 
extend your logical volume.



moka@hol.gr wrote:

>Hi there, new to LVM, so I would appreciate if you can 
>point me to answers to these questions:
>
>1) I have a system with 3 hard disks, and only one of 
>them is presently used. This contains boot, root and 
>swap plus a logical  partition(not LVM) containing
>/var and /home.
>
>I have big database tables, so I would like
> to create one volume group consisting of the 2
> unused disks plus the /var. Is this possible
> without losing what is in /var?
>2) The reason I need  a lot of space is that mysql
>  which I am using stores the database tables in /var.
> Can I somehow "name" the volume group /var
>  so that mysql will not be confused?
>
>Thanks in advance,
>S.Alexiou
>
>_______________________________________________
>linux-lvm mailing list
>linux-lvm@sistina.com
>http://lists.sistina.com/mailman/listinfo/linux-lvm
>read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] 2 LVM questions
  2001-07-20 13:34 [linux-lvm] 2 LVM questions moka
                   ` (2 preceding siblings ...)
  2001-07-20 14:38 ` Patrick Boutilier
@ 2001-07-20 15:34 ` Joe Thornber
  3 siblings, 0 replies; 5+ messages in thread
From: Joe Thornber @ 2001-07-20 15:34 UTC (permalink / raw)
  To: linux-lvm

On Fri, Jul 20, 2001 at 04:34:15PM +0300, moka@hol.gr wrote:
> 
> Hi there, new to LVM, so I would appreciate if you can 
> point me to answers to these questions:

First off, if you're new to LVM do not be tempted to try and run root
off an LV.

> 1) I have a system with 3 hard disks, and only one of 
> them is presently used. This contains boot, root and 
> swap plus a logical  partition(not LVM) containing
> /var and /home.
> 
> I have big database tables, so I would like
>  to create one volume group consisting of the 2
>  unused disks plus the /var. Is this possible
>  without losing what is in /var?

I suggest you create a volume group from the 2 spare disks.

create an lv big enough for var

format it and copy var into it and adjust /etc/fstab accordingly

at this point the old var can be added to the vg with vgextend,
however I would keep it around for a while until you are sure you have
set things up correctly.

> 2) The reason I need  a lot of space is that mysql
>   which I am using stores the database tables in /var.
>  Can I somehow "name" the volume group /var
>   so that mysql will not be confused?

mount the logical volume on /var

- Joe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-07-20 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-20 13:34 [linux-lvm] 2 LVM questions moka
2001-07-20 14:20 ` lembark
2001-07-20 14:28 ` Eric M. Hopper
2001-07-20 14:38 ` Patrick Boutilier
2001-07-20 15:34 ` Joe Thornber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.