RE: root filesystem copy ro raid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux