linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] lvm'ing root fs
@ 2000-04-11  0:59 Shaw, Marco
  2000-04-11  2:45 ` Andreas Dilger
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Shaw, Marco @ 2000-04-11  0:59 UTC (permalink / raw)
  To: linux-lvm

I've created an init ramdisk (lvmcreate_initrd), and now I'm in the process
of trying to copy my root fs to my new lvm_root.  To reduce the disk I/O,
I've gone down to single user mode to try to copy (cp -a *) all my files
from root to lvm_root.  Twice I get the same results:

# cd /
# cp -a * /mnt/root_vg
cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
cp: proc/sys/net/ipv4/route/flush: Invalid argument

This is all I see on my screen, then at some point, the copying stops, and
my system will not respond to keyboard input, except it will respond to
Alt-F1/4 to switch virtual terms, but still no keyboard input accepted.

Should I tar/untar instead, or did I miss some fundamental step?

Thanks,
Marco

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  0:59 [linux-lvm] lvm'ing root fs Shaw, Marco
@ 2000-04-11  2:45 ` Andreas Dilger
  2000-04-11  3:43 ` Peter C. Norton
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Andreas Dilger @ 2000-04-11  2:45 UTC (permalink / raw)
  To: Shaw, Marco; +Cc: Linux LVM mailing list

Marco writes:
> Twice I get the same results:
> 
> # cd /
> # cp -a * /mnt/root_vg
> cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> cp: proc/sys/net/ipv4/route/flush: Invalid argument

You should'nt try to copy /proc over.  The kcore file is actually the
copy of all of your RAM contents, and it can crash your system to read
from some parts of your memory (hardware ports and such).

Either limit the copy to a single partition (I don't know if "cp" has a
flag to do that), or unmount /proc before starting your copy.  You probably
also want to unmount your other filesystems as well (keeping only /) so
that your root LV only has files from / in it.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  0:59 [linux-lvm] lvm'ing root fs Shaw, Marco
  2000-04-11  2:45 ` Andreas Dilger
@ 2000-04-11  3:43 ` Peter C. Norton
  2000-04-11  4:21   ` Peter C. Norton
  2000-04-11  5:22 ` Torsten Landschoff
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Peter C. Norton @ 2000-04-11  3:43 UTC (permalink / raw)
  To: Shaw, Marco; +Cc: linux-lvm

You may want to do the following:

cd /; find . -xdev -print | xargs tar -cf - | (cd /mnt/root_vg; tar -xf -)

With gnu tar this should do everything you need.  Files, directories,
devices, etc. 

-Peter

On Mon, Apr 10, 2000 at 09:59:11PM -0300, Shaw, Marco wrote:
> I've created an init ramdisk (lvmcreate_initrd), and now I'm in the process
> of trying to copy my root fs to my new lvm_root.  To reduce the disk I/O,
> I've gone down to single user mode to try to copy (cp -a *) all my files
> from root to lvm_root.  Twice I get the same results:
> 
> # cd /
> # cp -a * /mnt/root_vg
> cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> cp: proc/sys/net/ipv4/route/flush: Invalid argument
> 
> This is all I see on my screen, then at some point, the copying stops, and
> my system will not respond to keyboard input, except it will respond to
> Alt-F1/4 to switch virtual terms, but still no keyboard input accepted.
> 
> Should I tar/untar instead, or did I miss some fundamental step?
> 
> Thanks,
> Marco

-- 
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  3:43 ` Peter C. Norton
@ 2000-04-11  4:21   ` Peter C. Norton
  2000-04-11  4:51     ` Michael Loftis
  2000-04-11  5:24     ` Torsten Landschoff
  0 siblings, 2 replies; 13+ messages in thread
From: Peter C. Norton @ 2000-04-11  4:21 UTC (permalink / raw)
  To: Shaw, Marco; +Cc: linux-lvm

Looking at that a second time, you may be better off adding the "-type f"
flag to find so you don't include /usr, etc.

On Mon, Apr 10, 2000 at 08:43:58PM -0700, Peter C. Norton wrote:
> You may want to do the following:
> 
> cd /; find . -xdev -print | xargs tar -cf - | (cd /mnt/root_vg; tar -xf -)
> 
> With gnu tar this should do everything you need.  Files, directories,
> devices, etc. 
> 
> -Peter
> 
> On Mon, Apr 10, 2000 at 09:59:11PM -0300, Shaw, Marco wrote:
> > I've created an init ramdisk (lvmcreate_initrd), and now I'm in the process
> > of trying to copy my root fs to my new lvm_root.  To reduce the disk I/O,
> > I've gone down to single user mode to try to copy (cp -a *) all my files
> > from root to lvm_root.  Twice I get the same results:
> > 
> > # cd /
> > # cp -a * /mnt/root_vg
> > cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> > cp: proc/sys/net/ipv4/route/flush: Invalid argument
> > 
> > This is all I see on my screen, then at some point, the copying stops, and
> > my system will not respond to keyboard input, except it will respond to
> > Alt-F1/4 to switch virtual terms, but still no keyboard input accepted.
> > 
> > Should I tar/untar instead, or did I miss some fundamental step?
> > 
> > Thanks,
> > Marco
> 
> -- 
> The 5 year plan:
> In five years we'll make up another plan.
> Or just re-use this one.

-- 
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  4:21   ` Peter C. Norton
@ 2000-04-11  4:51     ` Michael Loftis
  2000-04-11  5:10       ` Peter C. Norton
  2000-04-11  5:24     ` Torsten Landschoff
  1 sibling, 1 reply; 13+ messages in thread
From: Michael Loftis @ 2000-04-11  4:51 UTC (permalink / raw)
  To: Peter C. Norton; +Cc: Shaw, Marco, linux-lvm

No because he needs /dev/* entries :)

-not -path "/usr/*" 

Prolly need whatever else isn't wanted on the initrd (like /home if it
lives there) so use with caution (bin, sbin, lib and boot are prolly all
thats necessary -- but I not sure -- I know the kernel has to be outside
of the LVM though)

Anyway...

On Mon, 10 Apr 2000, Peter C. Norton wrote:

> Looking at that a second time, you may be better off adding the "-type f"
> flag to find so you don't include /usr, etc.
> 
> On Mon, Apr 10, 2000 at 08:43:58PM -0700, Peter C. Norton wrote:
> > You may want to do the following:
> > 
> > cd /; find . -xdev -print | xargs tar -cf - | (cd /mnt/root_vg; tar -xf -)
> > 
> > With gnu tar this should do everything you need.  Files, directories,
> > devices, etc. 
> > 
> > -Peter
> > 
> > On Mon, Apr 10, 2000 at 09:59:11PM -0300, Shaw, Marco wrote:
> > > I've created an init ramdisk (lvmcreate_initrd), and now I'm in the process
> > > of trying to copy my root fs to my new lvm_root.  To reduce the disk I/O,
> > > I've gone down to single user mode to try to copy (cp -a *) all my files
> > > from root to lvm_root.  Twice I get the same results:
> > > 
> > > # cd /
> > > # cp -a * /mnt/root_vg
> > > cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> > > cp: proc/sys/net/ipv4/route/flush: Invalid argument
> > > 
> > > This is all I see on my screen, then at some point, the copying stops, and
> > > my system will not respond to keyboard input, except it will respond to
> > > Alt-F1/4 to switch virtual terms, but still no keyboard input accepted.
> > > 
> > > Should I tar/untar instead, or did I miss some fundamental step?
> > > 
> > > Thanks,
> > > Marco
> > 
> > -- 
> > The 5 year plan:
> > In five years we'll make up another plan.
> > Or just re-use this one.
> 
> -- 
> The 5 year plan:
> In five years we'll make up another plan.
> Or just re-use this one.
> 

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  4:51     ` Michael Loftis
@ 2000-04-11  5:10       ` Peter C. Norton
  0 siblings, 0 replies; 13+ messages in thread
From: Peter C. Norton @ 2000-04-11  5:10 UTC (permalink / raw)
  To: Michael Loftis; +Cc: Shaw, Marco, linux-lvm

Now we don't want /usr, or /proc, or /tmp, or /opt, or /boot, /lost+found,
/home, /var, but you want the directories.

I now vote for:

umask 022
tar -cf - /dev /bin /sbin /root /lib /etc | (cd /mnt/root_vg; tar -xvf -)
cd /mnt/root_vg; mkdir boot home mnt opt tmp usr var

Unless your /tmp is on the / filesystem.  

Anyway, that should do it :)

-Peter

It could also be done as:
find /dev -type f -o -type p -o -type b -o -type c
but it'd be easier to do:

cd /; find . -xdev -print | xargs tar -cf - /dev| (cd /mnt/root_vg; tar -xf -)

On Mon, Apr 10, 2000 at 10:51:48PM -0600, Michael Loftis wrote:
> No because he needs /dev/* entries :)
> 
> -not -path "/usr/*" 
> 
> Prolly need whatever else isn't wanted on the initrd (like /home if it
> lives there) so use with caution (bin, sbin, lib and boot are prolly all
> thats necessary -- but I not sure -- I know the kernel has to be outside
> of the LVM though)
> 
> Anyway...
> 
> On Mon, 10 Apr 2000, Peter C. Norton wrote:
> 
> > Looking at that a second time, you may be better off adding the "-type f"
> > flag to find so you don't include /usr, etc.
> > 
> > On Mon, Apr 10, 2000 at 08:43:58PM -0700, Peter C. Norton wrote:
> > > You may want to do the following:
> > > 
> > > cd /; find . -xdev -print | xargs tar -cf - | (cd /mnt/root_vg; tar -xf -)
> > > 
> > > With gnu tar this should do everything you need.  Files, directories,
> > > devices, etc. 
> > > 
> > > -Peter
> > > 
> > > On Mon, Apr 10, 2000 at 09:59:11PM -0300, Shaw, Marco wrote:
> > > > I've created an init ramdisk (lvmcreate_initrd), and now I'm in the process
> > > > of trying to copy my root fs to my new lvm_root.  To reduce the disk I/O,
> > > > I've gone down to single user mode to try to copy (cp -a *) all my files
> > > > from root to lvm_root.  Twice I get the same results:
> > > > 
> > > > # cd /
> > > > # cp -a * /mnt/root_vg
> > > > cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> > > > cp: proc/sys/net/ipv4/route/flush: Invalid argument
> > > > 
> > > > This is all I see on my screen, then at some point, the copying stops, and
> > > > my system will not respond to keyboard input, except it will respond to
> > > > Alt-F1/4 to switch virtual terms, but still no keyboard input accepted.
> > > > 
> > > > Should I tar/untar instead, or did I miss some fundamental step?
> > > > 
> > > > Thanks,
> > > > Marco
> > > 
> > > -- 
> > > The 5 year plan:
> > > In five years we'll make up another plan.
> > > Or just re-use this one.
> > 
> > -- 
> > The 5 year plan:
> > In five years we'll make up another plan.
> > Or just re-use this one.
> > 
> 

-- 
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  0:59 [linux-lvm] lvm'ing root fs Shaw, Marco
  2000-04-11  2:45 ` Andreas Dilger
  2000-04-11  3:43 ` Peter C. Norton
@ 2000-04-11  5:22 ` Torsten Landschoff
  2000-04-11  9:31 ` Patrick Boutilier
  2000-04-11  9:32 ` Patrick Boutilier
  4 siblings, 0 replies; 13+ messages in thread
From: Torsten Landschoff @ 2000-04-11  5:22 UTC (permalink / raw)
  To: Shaw, Marco; +Cc: linux-lvm

On Mon, Apr 10, 2000 at 09:59:11PM -0300, Shaw, Marco wrote:
> # cd /
> # cp -a * /mnt/root_vg
> cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> cp: proc/sys/net/ipv4/route/flush: Invalid argument

Use cp -ax to stay in the same filesystem.

cu
	Torsten

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  4:21   ` Peter C. Norton
  2000-04-11  4:51     ` Michael Loftis
@ 2000-04-11  5:24     ` Torsten Landschoff
  2000-04-11  6:14       ` Ulf Bartelt
  1 sibling, 1 reply; 13+ messages in thread
From: Torsten Landschoff @ 2000-04-11  5:24 UTC (permalink / raw)
  To: Peter C. Norton; +Cc: Shaw, Marco, linux-lvm

On Mon, Apr 10, 2000 at 09:21:32PM -0700, Peter C. Norton wrote:
> Looking at that a second time, you may be better off adding the "-type f"
> flag to find so you don't include /usr, etc.
> 
> On Mon, Apr 10, 2000 at 08:43:58PM -0700, Peter C. Norton wrote:
> > You may want to do the following:
> > 
> > cd /; find . -xdev -print | xargs tar -cf - | (cd /mnt/root_vg; tar -xf -)

If you want to use tar the easiest way is to use is probably in the Tips-HOWTO:

2.6.  Moving directories between filesystems. Alan Cox, A.Cox@swansea.ac.uk 

    Quick way to move an entire tree of files from one disk to another

   (cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)

HTH

	Torsten

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  5:24     ` Torsten Landschoff
@ 2000-04-11  6:14       ` Ulf Bartelt
  2000-04-11  8:43         ` Re[2]: " Jens Bruckmann
  0 siblings, 1 reply; 13+ messages in thread
From: Ulf Bartelt @ 2000-04-11  6:14 UTC (permalink / raw)
  To: linux-lvm

Torsten Landschoff wrote:
>    (cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)

I use:

tar clCf sourcedir - . | tar xvpCf destdir -

...at least with gnu tar...

...will skip mounted filesystems due to the "l" option...
...will chdir to sourcedir/destdir due to the "C" option...


...or did i miss something?


Bye!
	Ulf.

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

* Re[2]: [linux-lvm] lvm'ing root fs
  2000-04-11  6:14       ` Ulf Bartelt
@ 2000-04-11  8:43         ` Jens Bruckmann
  2000-04-11 19:01           ` Luca Berra
  0 siblings, 1 reply; 13+ messages in thread
From: Jens Bruckmann @ 2000-04-11  8:43 UTC (permalink / raw)
  To: linux-lvm

Hello all,

UB> tar clCf sourcedir - . | tar xvpCf destdir -

next decision:
I used cpio for this:

find /sourcedir -print | cpio -pvumdl /destdir

Bye,
    Jens Bruckmann

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  0:59 [linux-lvm] lvm'ing root fs Shaw, Marco
                   ` (2 preceding siblings ...)
  2000-04-11  5:22 ` Torsten Landschoff
@ 2000-04-11  9:31 ` Patrick Boutilier
  2000-04-11  9:32 ` Patrick Boutilier
  4 siblings, 0 replies; 13+ messages in thread
From: Patrick Boutilier @ 2000-04-11  9:31 UTC (permalink / raw)
  To: Shaw, Marco; +Cc: linux-lvm

I've used rsync to move a whole / filesystem.

rsync -avr --exclude-from=FILE /mnt_root_vg/* /.

Put anything you want excluded in the "FILE" file.

"Shaw, Marco" wrote:

> I've created an init ramdisk (lvmcreate_initrd), and now I'm in the process
> of trying to copy my root fs to my new lvm_root.  To reduce the disk I/O,
> I've gone down to single user mode to try to copy (cp -a *) all my files
> from root to lvm_root.  Twice I get the same results:
>
> # cd /
> # cp -a * /mnt/root_vg
> cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> cp: proc/sys/net/ipv4/route/flush: Invalid argument
>
> This is all I see on my screen, then at some point, the copying stops, and
> my system will not respond to keyboard input, except it will respond to
> Alt-F1/4 to switch virtual terms, but still no keyboard input accepted.
>
> Should I tar/untar instead, or did I miss some fundamental step?
>
> Thanks,
> Marco

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  0:59 [linux-lvm] lvm'ing root fs Shaw, Marco
                   ` (3 preceding siblings ...)
  2000-04-11  9:31 ` Patrick Boutilier
@ 2000-04-11  9:32 ` Patrick Boutilier
  4 siblings, 0 replies; 13+ messages in thread
From: Patrick Boutilier @ 2000-04-11  9:32 UTC (permalink / raw)
  To: Shaw, Marco; +Cc: linux-lvm

Second attempt with correction to rsync statement.


I've used rsync to move a whole / filesystem.

rsync -avr --exclude-from=FILE /mnt/root_vg/* /.

Put anything you want excluded in the "FILE" file.

"Shaw, Marco" wrote:

> I've created an init ramdisk (lvmcreate_initrd), and now I'm in the process
> of trying to copy my root fs to my new lvm_root.  To reduce the disk I/O,
> I've gone down to single user mode to try to copy (cp -a *) all my files
> from root to lvm_root.  Twice I get the same results:
>
> # cd /
> # cp -a * /mnt/root_vg
> cp: /mnt/root_vg/proc/kcore_elf: Invalid argument
> cp: proc/sys/net/ipv4/route/flush: Invalid argument
>
> This is all I see on my screen, then at some point, the copying stops, and
> my system will not respond to keyboard input, except it will respond to
> Alt-F1/4 to switch virtual terms, but still no keyboard input accepted.
>
> Should I tar/untar instead, or did I miss some fundamental step?
>
> Thanks,
> Marco

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

* Re: [linux-lvm] lvm'ing root fs
  2000-04-11  8:43         ` Re[2]: " Jens Bruckmann
@ 2000-04-11 19:01           ` Luca Berra
  0 siblings, 0 replies; 13+ messages in thread
From: Luca Berra @ 2000-04-11 19:01 UTC (permalink / raw)
  To: linux-lvm

On Tue, Apr 11, 2000 at 10:43:46AM +0200, Jens Bruckmann wrote:
> I used cpio for this:
> 
> find /sourcedir -print | cpio -pvumdl /destdir

thass better, if u have gnu find & cpio use
find /sourcedir -print0 | cpio -0padmuV
(-0 deals with files with \n embedded, -l in your command
would try to link files)

L.

-- 
Luca Berra -- bluca@comedia.it
    Communication Media & Services S.r.l.

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

end of thread, other threads:[~2000-04-11 19:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-11  0:59 [linux-lvm] lvm'ing root fs Shaw, Marco
2000-04-11  2:45 ` Andreas Dilger
2000-04-11  3:43 ` Peter C. Norton
2000-04-11  4:21   ` Peter C. Norton
2000-04-11  4:51     ` Michael Loftis
2000-04-11  5:10       ` Peter C. Norton
2000-04-11  5:24     ` Torsten Landschoff
2000-04-11  6:14       ` Ulf Bartelt
2000-04-11  8:43         ` Re[2]: " Jens Bruckmann
2000-04-11 19:01           ` Luca Berra
2000-04-11  5:22 ` Torsten Landschoff
2000-04-11  9:31 ` Patrick Boutilier
2000-04-11  9:32 ` Patrick Boutilier

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).