linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* root filesystem copy ro raid
@ 2003-02-17  5:39 Lewis Shobbrook
  2003-02-17  8:21 ` Luca Berra
  0 siblings, 1 reply; 3+ messages in thread
From: Lewis Shobbrook @ 2003-02-17  5:39 UTC (permalink / raw)
  To: linux-raid

I'm surprised to find such little info on copying an existing filesystem
onto a new raid partition.  
The howto's use cp -a or pipe to cpio -pm .
I've tried both methods, but here we have the problem of symbolic links
and hardlinks not being copied, which when you have an elaborate system
that you'd like to migrate across to raid, doesn't cut the mustard. 
Has anyone tried or succeeded with any alternate methods?  Are there any
utilities such as parted to copy the whole lot.  
I'm not sure how apps such as parted work, but as /dev/mdX is formatted
with mke2fs, as is most root filesystem, I'd like to hope that with a
raid aware kernel and the root filesystem unmounted it could be copied
directly eg.  /dev/hda1 => /dev/mdX.

Apologies if this topic has been visited before, I couldn't find any
reference to it in the archives...


Lewis


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

* Re: root filesystem copy ro raid
  2003-02-17  5:39 root filesystem copy ro raid Lewis Shobbrook
@ 2003-02-17  8:21 ` Luca Berra
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Berra @ 2003-02-17  8:21 UTC (permalink / raw)
  To: linux-raid

On Mon, Feb 17, 2003 at 04:39:23PM +1100, Lewis Shobbrook wrote:
>The howto's use cp -a or pipe to cpio -pm .

sigh....

cd /source
find . -xdev -print0 | cpio -padum0 -v --sparse /target

-v and --sparse are optional

L.
-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

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

* RE: root filesystem copy ro raid
@ 2003-02-17 15:47 Cress, Andrew R
  0 siblings, 0 replies; 3+ messages in thread
From: Cress, Andrew R @ 2003-02-17 15:47 UTC (permalink / raw)
  To: 'Lewis Shobbrook', linux-raid

Lewis,

Here's what I use for that.

Andy

   # Script 8 to copy Linux files to mounted tree
   todir=/mnt/b
   notf=/tmp/dirnot.tmp
   cat - <<%%% >$notf
tmp
proc
mnt
boot
lost+found
%%%
   dirs=`ls / |grep -vf $notf`
   cd /
   # Copy each directory in the list
   # could use "find . -print | cpio -pdumv" if grep -v extra stuff. 
   for d in $dirs
   do
       echo "Copying $d to $todir/$d..."
       cp -a $d $todir
   done
   # Do /tmp, /proc, /mnt, and /boot specially
   echo "Creating $todir/tmp, mnt, proc..."
   mkdir -p $todir/tmp  
   chmod 777 $todir/tmp
   chmod +t $todir/tmp
   mkdir -p $todir/proc
   # makes /mnt directories like cdrom and floppy
   for i in `ls -l /mnt |grep "^dr" |cut -c57-80`
   do
       mkdir -p $todir/mnt/$i
   done
   echo "Copying boot to $todir/boot..."
   cp -f /boot/* $todir/boot 2>/dev/null
   # This will usually give an "omitting lost+found" stderr message.   
   # end script 8


-----Original Message-----
From: Lewis Shobbrook [mailto:lshobbrook@fasttrack.net.au] 
Sent: Monday, February 17, 2003 12:39 AM
To: linux-raid@vger.kernel.org
Subject: root filesystem copy ro raid


I'm surprised to find such little info on copying an existing filesystem
onto a new raid partition.  
The howto's use cp -a or pipe to cpio -pm .
I've tried both methods, but here we have the problem of symbolic links
and hardlinks not being copied, which when you have an elaborate system
that you'd like to migrate across to raid, doesn't cut the mustard. 
Has anyone tried or succeeded with any alternate methods?  Are there any
utilities such as parted to copy the whole lot.  
I'm not sure how apps such as parted work, but as /dev/mdX is formatted
with mke2fs, as is most root filesystem, I'd like to hope that with a
raid aware kernel and the root filesystem unmounted it could be copied
directly eg.  /dev/hda1 => /dev/mdX.

Apologies if this topic has been visited before, I couldn't find any
reference to it in the archives...


Lewis

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2003-02-17 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-17  5:39 root filesystem copy ro raid Lewis Shobbrook
2003-02-17  8:21 ` Luca Berra
  -- strict thread matches above, loose matches on Subject: below --
2003-02-17 15:47 Cress, Andrew R

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