linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Newbie of LVM
@ 2005-12-09  3:39 Way Loss
  2005-12-09 18:50 ` Anil Kumar Sharma
  2005-12-09 19:12 ` Matthew Gillen
  0 siblings, 2 replies; 10+ messages in thread
From: Way Loss @ 2005-12-09  3:39 UTC (permalink / raw)
  To: linux-lvm

Hi all,

   I am very new to LVM. Here is the detail of my
current fs.
Filesystem            Size  Used Avail Use% Mounted on
/dev/md1              9.4G  2.5G  6.5G  28% /
/dev/md2              9.4G  7.6G  1.4G  85% /home
/dev/md3              9.4G  6.6G  2.4G  74% /var
/dev/md4              958M   18M  892M   2% /tmp
/dev/md5              153G  119G   27G  82% /www

    My md5 is almost full and I wanna use LVM to merge
my md5 with a new partition from a new hdd. I wanna
ask if this possible for LVM to merge 2 partition
together while one of them have data on it? I can't
suffer any data loss and want to make sure that LVM
works perfectly to what I want.
   Thanks all.

Best Regards,
Sing

_______________________________________
 �x��ӍϢ - Yahoo! Messenger
 ������]���ϾW����������Կ�������ӍϢ�o�㣬�����ϾW�r���������������κ��fԒ������ʧ��
  http://messenger.yahoo.com.hk 

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09  3:39 [linux-lvm] Newbie of LVM Way Loss
@ 2005-12-09 18:50 ` Anil Kumar Sharma
  2005-12-09 19:12 ` Matthew Gillen
  1 sibling, 0 replies; 10+ messages in thread
From: Anil Kumar Sharma @ 2005-12-09 18:50 UTC (permalink / raw)
  To: LVM general discussion and development

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

U should confirm this before going ahead,

I believe that's what LVM is good for, or else why use it in the first
place?

{
Logical volume management is traditionally associated with large
installations containing many disks but it is equally suited to small
systems with a single disk or maybe two.
}   <- this is from Why would I want
it?<http://tldp.org/HOWTO/LVM-HOWTO/whywouldiwantit.html>


and this will take U home -> Benefits of Logical Volume Management on a
Small System <http://tldp.org/HOWTO/LVM-HOWTO/benefitsoflvmsmall.html>

HTH
--
Anil Kumar Shrama

[-- Attachment #2: Type: text/html, Size: 783 bytes --]

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09  3:39 [linux-lvm] Newbie of LVM Way Loss
  2005-12-09 18:50 ` Anil Kumar Sharma
@ 2005-12-09 19:12 ` Matthew Gillen
  2005-12-09 19:38   ` Jeff Cousino
                     ` (3 more replies)
  1 sibling, 4 replies; 10+ messages in thread
From: Matthew Gillen @ 2005-12-09 19:12 UTC (permalink / raw)
  To: LVM general discussion and development

Way Loss wrote:
> Hi all,
> 
>    I am very new to LVM. Here is the detail of my
> current fs.
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/md1              9.4G  2.5G  6.5G  28% /
> /dev/md2              9.4G  7.6G  1.4G  85% /home
> /dev/md3              9.4G  6.6G  2.4G  74% /var
> /dev/md4              958M   18M  892M   2% /tmp
> /dev/md5              153G  119G   27G  82% /www
> 
>     My md5 is almost full and I wanna use LVM to merge
> my md5 with a new partition from a new hdd. I wanna
> ask if this possible for LVM to merge 2 partition
> together while one of them have data on it? I can't
> suffer any data loss and want to make sure that LVM
> works perfectly to what I want.
>    Thanks all.

You're out of luck.  You can't take an existing partition and keep the
data yet switch it over to LVM.  It's like RAID that way: you need to
set up the lower level stuff *before* you format the disk/partition with
your filesystem and start putting data on it.

To do what you want is possible, provided that you created an LVM from
the beginning that had md5 as a PhysicalVolume, then created your
filesystem on the Logical Volume.  But it seems clear from your fstab
that you didn't do that.

Sorry,
--Matt

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09 19:12 ` Matthew Gillen
@ 2005-12-09 19:38   ` Jeff Cousino
  2005-12-09 19:43     ` Matthew Gillen
  2005-12-09 19:48     ` Graham Wood
  2005-12-09 19:42   ` Matthew Gillen
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Jeff Cousino @ 2005-12-09 19:38 UTC (permalink / raw)
  To: LVM general discussion and development

> You're out of luck.  You can't take an existing partition and keep the
> data yet switch it over to LVM.  It's like RAID that way: you need to
> set up the lower level stuff *before* you format the disk/partition with
> your filesystem and start putting data on it.
>

But couldn't he set up his new drive with LVM copy the data from the
old drive to it, provided it's large enough and then add the old drive
to the group?

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09 19:12 ` Matthew Gillen
  2005-12-09 19:38   ` Jeff Cousino
@ 2005-12-09 19:42   ` Matthew Gillen
  2005-12-09 19:57   ` Anil Kumar Sharma
  2005-12-12 15:21   ` Alasdair G Kergon
  3 siblings, 0 replies; 10+ messages in thread
From: Matthew Gillen @ 2005-12-09 19:42 UTC (permalink / raw)
  To: LVM general discussion and development

Matthew Gillen wrote:
> Way Loss wrote:
> 
>>Hi all,
>>
>>   I am very new to LVM. Here is the detail of my
>>current fs.
>>Filesystem            Size  Used Avail Use% Mounted on
>>/dev/md1              9.4G  2.5G  6.5G  28% /
>>/dev/md2              9.4G  7.6G  1.4G  85% /home
>>/dev/md3              9.4G  6.6G  2.4G  74% /var
>>/dev/md4              958M   18M  892M   2% /tmp
>>/dev/md5              153G  119G   27G  82% /www
>>
>>    My md5 is almost full and I wanna use LVM to merge
>>my md5 with a new partition from a new hdd. I wanna
>>ask if this possible for LVM to merge 2 partition
>>together while one of them have data on it? I can't
>>suffer any data loss and want to make sure that LVM
>>works perfectly to what I want.
>>   Thanks all.
> 
> 
> You're out of luck.  You can't take an existing partition and keep the
> data yet switch it over to LVM.  It's like RAID that way: you need to
> set up the lower level stuff *before* you format the disk/partition with
> your filesystem and start putting data on it.
> 
> To do what you want is possible, provided that you created an LVM from
> the beginning that had md5 as a PhysicalVolume, then created your
> filesystem on the Logical Volume.  But it seems clear from your fstab
> that you didn't do that.

Well, you're not totally out of luck, assuming the other disk is as big
or bigger than /dev/md5:
You could create an LVM with the new disk, create your filesystem, copy
the contents of md5 to the new LVM filesystem (via tar/cpio or something
that will preserve symlinks etc), then add md5 to the LVM setup (thereby
destroying the data on md5) and resize your filesystem.
--Matt

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09 19:38   ` Jeff Cousino
@ 2005-12-09 19:43     ` Matthew Gillen
  2005-12-09 19:48     ` Graham Wood
  1 sibling, 0 replies; 10+ messages in thread
From: Matthew Gillen @ 2005-12-09 19:43 UTC (permalink / raw)
  To: LVM general discussion and development

Jeff Cousino wrote:
>>You're out of luck.  You can't take an existing partition and keep the
>>data yet switch it over to LVM.  It's like RAID that way: you need to
>>set up the lower level stuff *before* you format the disk/partition with
>>your filesystem and start putting data on it.
>>
> 
> 
> But couldn't he set up his new drive with LVM copy the data from the
> old drive to it, provided it's large enough and then add the old drive
> to the group?

Right,  I was writing a followup to this effect before I got your response.

--Matt

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09 19:38   ` Jeff Cousino
  2005-12-09 19:43     ` Matthew Gillen
@ 2005-12-09 19:48     ` Graham Wood
  1 sibling, 0 replies; 10+ messages in thread
From: Graham Wood @ 2005-12-09 19:48 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, Dec 09, 2005 at 02:38:49PM -0500, Jeff Cousino wrote:
> But couldn't he set up his new drive with LVM copy the data from the
> old drive to it, provided it's large enough and then add the old drive
> to the group?
As long as he can get the downtime to do it, sure.  At that point the
device '/dev/md5' can be added as a PV and the volume grown.

However - to do that he'd need to unmount the existing volume, ideally
for the time it took to do the copy (although there are ways around
that). 

And also, the answer to the initial question is still no, since that's
just a different way to do it.

If the new storage device is big enough (and the solution wanted is not
a RAID that requires the existing disk space to build) then the
following would be a way to do it:

1. Create the PV/VG on the new disk (since it doesn't look as though LVM 
is in use at all on that machine, if it is then do as appropriate)
2. Create the new volume, and mount it under /mnt or something.
3. use rsync to get the two volumes (existing & new) in sync.  The
command I use is:
	rsync --delete-after -av /www /mnt
4. Arrange a downtime of at least 15 minutes, and during that move the
mount points around (after stopping all applications that use /www):
	rsync --delete-after -av /www /mnt # bring the copy up to date
	umount /mnt
	umount /www
	mount <LVM device> /www
5. Restart all the applications

Things to note about this are that not only does it require a lot of
disk space, but it also will be quite slow (especially if there are lots
of little files on /www).  If you start work well before you can arrange
the downtime (last time I did this I had everything in place and had to
wait 2 weeks for the window to do the rotation) then you can keep
running the rsync to keep the two copies closer together and therefore
keep the downtime to a minimum.

A shorter term solution would be to migrate some of the data off /www
and use symlinks.  That would still require a brief downtime to move
around the data - but it doesn't require the big hit.  (e.g. mount the
new partition as /www2 and then move /www/site1 to /www2/site1 and then
create a symlink /www/site1 to /www2/site1 - couple of other things to
be aware of, but that's the principle).

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09 19:12 ` Matthew Gillen
  2005-12-09 19:38   ` Jeff Cousino
  2005-12-09 19:42   ` Matthew Gillen
@ 2005-12-09 19:57   ` Anil Kumar Sharma
  2005-12-09 20:03     ` Anil Kumar Sharma
  2005-12-12 15:21   ` Alasdair G Kergon
  3 siblings, 1 reply; 10+ messages in thread
From: Anil Kumar Sharma @ 2005-12-09 19:57 UTC (permalink / raw)
  To: LVM general discussion and development

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

Yes, it is possible and this is the way LVM is supposed to work else who
will touch it?
U will need to copy your data at least once,
I mean, to merge, U must have your data on LVM - so get it there !!

Since U will have a shining brand new HDD, and your taste says it will be
bigger than previous one - has to be, else drop the idea or data!

So brief steps would be (Details, please work out precisely before
proceeding or ask)

0. Read LVM things before hand - they will come very handy because U are now
embracing LVM.

1. plug New HDD in the box, and get it going.
2. Get LVM on new disk going. PV, PE, VG, LV, etc all done.
3. Copy (please note - copy it is - not move - not shift)  copy data to new
disc to LVM partition created on new disk.

4. Reboot and "confirm" that new data is available (Do not skip this step).

5. "ReConfirm" by all means that your data is safe sound and reachable on
new disc. Like use it again and again and earn confidence with it.
Check data presence through your software etc etc etc etc.

6. I do not wish to use capitals but "do not delete your old data on md5"
"do not delete your old data on md5".
6.1 Keep it as backup for few days till U become comfortable with your data
in new location.

 ### Important ### U C, U have a new disc, may be, twice the size of old
disc.... just wait before U delete old data.

7. Then onwards it will be like house keeping. I mean merging of partitions
starts now . And for that u will have to reformat (or wait for FC8, it may
be sooner) your old partition. Read LVM thoroughly, it is good only with
caution.

I again remind that U are playing with data, keep backup.



> >
> >     My md5 is almost full and I wanna use LVM to merge
> > my md5 with a new partition from a new hdd. I wanna
> > ask if this possible for LVM to merge 2 partition
> > together while one of them have data on it? I can't
> > suffer any data loss and want to make sure that LVM
> > works perfectly to what I want.
> >    Thanks all.
>
>
> --
> Anil Kumar Shrama

[-- Attachment #2: Type: text/html, Size: 2718 bytes --]

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09 19:57   ` Anil Kumar Sharma
@ 2005-12-09 20:03     ` Anil Kumar Sharma
  0 siblings, 0 replies; 10+ messages in thread
From: Anil Kumar Sharma @ 2005-12-09 20:03 UTC (permalink / raw)
  To: LVM general discussion and development

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

This list moves fast....4 hits  before a send button hit.... brief  is a
word..

--
Anil Kumar Shrama

[-- Attachment #2: Type: text/html, Size: 174 bytes --]

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

* Re: [linux-lvm] Newbie of LVM
  2005-12-09 19:12 ` Matthew Gillen
                     ` (2 preceding siblings ...)
  2005-12-09 19:57   ` Anil Kumar Sharma
@ 2005-12-12 15:21   ` Alasdair G Kergon
  3 siblings, 0 replies; 10+ messages in thread
From: Alasdair G Kergon @ 2005-12-12 15:21 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, Dec 09, 2005 at 02:12:43PM -0500, Matthew Gillen wrote:
> Way Loss wrote:

> > /dev/md5              153G  119G   27G  82% /www

> >     My md5 is almost full and I wanna use LVM to merge
> > my md5 with a new partition from a new hdd. I wanna
> > ask if this possible for LVM to merge 2 partition
> > together while one of them have data on it? I can't
> > suffer any data loss and want to make sure that LVM
> > works perfectly to what I want.

> You're out of luck.  You can't take an existing partition and keep the
> data yet switch it over to LVM.

See also:
  https://www.redhat.com/archives/linux-lvm/2005-October/msg00110.html

Alasdair
-- 
agk@redhat.com

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

end of thread, other threads:[~2005-12-12 15:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-09  3:39 [linux-lvm] Newbie of LVM Way Loss
2005-12-09 18:50 ` Anil Kumar Sharma
2005-12-09 19:12 ` Matthew Gillen
2005-12-09 19:38   ` Jeff Cousino
2005-12-09 19:43     ` Matthew Gillen
2005-12-09 19:48     ` Graham Wood
2005-12-09 19:42   ` Matthew Gillen
2005-12-09 19:57   ` Anil Kumar Sharma
2005-12-09 20:03     ` Anil Kumar Sharma
2005-12-12 15:21   ` Alasdair G Kergon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).