How to transfer the root file system

How to transfer the root file system

Post by tthav » Mon, 16 Apr 2001 10:58:22



Hi All
I have install redhat 6.2 with the kernel 2.2.17-4. Now I need to transfer
the entire os to another disk arry with the same system. The reason being
for that is I had problem with mylex 352 raid card. I have installed &
compiled 2.2.17-4 in order to get the drivers by connecting an external HD.
Now I need to transfer the OS inorder to boot from DISK ARRY.
How yo transfer, Can I use dd command dd if=/dev/sda1 of=/dev/rd/c0d0p1 ?,
Or with any other option?. The root partition of both drives are different
size. Or can I use dd if=/dev/sda1 of=/dev/rd/c0d0p1 conv=notrunc.
Please advice

Thanks in Advance
Thave

 
 
 

How to transfer the root file system

Post by Erik Veenstr » Mon, 16 Apr 2001 18:24:16



> Hi All
> I have install redhat 6.2 with the kernel 2.2.17-4. Now I need to transfer
> the entire os to another disk arry with the same system. The reason being
> for that is I had problem with mylex 352 raid card. I have installed &
> compiled 2.2.17-4 in order to get the drivers by connecting an external HD.
> Now I need to transfer the OS inorder to boot from DISK ARRY.
> How yo transfer, Can I use dd command dd if=/dev/sda1 of=/dev/rd/c0d0p1 ?,
> Or with any other option?. The root partition of both drives are different
> size. Or can I use dd if=/dev/sda1 of=/dev/rd/c0d0p1 conv=notrunc.
> Please advice

> Thanks in Advance
> Thave

I use this script to copy my 'production partitions' (/, /usr and /var)
to an empty partition (/root/linux2, hda7). Rebooting with the new root
let me test new packages and scripts, without the chance of damaging my
'production system'.

The blanks after after hda1 and $RO in...

sed s/"hda1     "/"$RO  "/g > ./etc/fstab

... are tabs, not spaces!

gegroet,
Erik V.

--------------------- begin of script ------------------------
WD=~/linux2
KE=vmlinuz
RO=hda7

pushd ~

  [ "$WD" = "" ] && echo "Oops!" && exit 16
  [ ! -d "$WD" ] && evdo "mkdir -p $WD"
  [ ! -d "$WD" ] && echo "Oops!" && exit 16

  evdo "grep $WD < /etc/fstab > /dev/null"      &&
  evdo "grep $WD < /etc/mtab  > /dev/null"      ||
  evdo "mount $WD"

popd

[ "$WD" = "/root/linux2" ] &&
 evdo "rm -rf $WD/*"

pushd $WD

  evdo "cp -aPx /    ."                 &&
  evdo "cp -aPx /usr ."                 &&
  evdo "cp -aPx /var ."                 &&
  evdo "rdev ./boot/$KE ./dev/$RO"      &&
  evdo "lilo"                           &&
  evdo "rm ./etc/lilo.conf"             &&
  echo "sed ..."                        &&
  cat /etc/fstab                | \
        grep -v /var            | \
        grep -v /usr            | \
        grep -v /root/linux2    | \
        sed s/"hda1     "/"$RO  "/g > ./etc/fstab

popd
--------------------- end of script ------------------------

 
 
 

How to transfer the root file system

Post by Erik Veenstr » Mon, 16 Apr 2001 18:36:51




> > Hi All
> > I have install redhat 6.2 with the kernel 2.2.17-4. Now I need to transfer
> > the entire os to another disk arry with the same system. The reason being
> > for that is I had problem with mylex 352 raid card. I have installed &
> > compiled 2.2.17-4 in order to get the drivers by connecting an external HD.
> > Now I need to transfer the OS inorder to boot from DISK ARRY.
> > How yo transfer, Can I use dd command dd if=/dev/sda1 of=/dev/rd/c0d0p1 ?,
> > Or with any other option?. The root partition of both drives are different
> > size. Or can I use dd if=/dev/sda1 of=/dev/rd/c0d0p1 conv=notrunc.
> > Please advice

> > Thanks in Advance
> > Thave

> I use this script to copy my 'production partitions' (/, /usr and /var)
> to an empty partition (/root/linux2, hda7). Rebooting with the new root
> let me test new packages and scripts, without the chance of damaging my
> 'production system'.

> The blanks after after hda1 and $RO in...

> sed s/"hda1     "/"$RO  "/g > ./etc/fstab

> ... are tabs, not spaces!

> gegroet,
> Erik V.

> --------------------- begin of script ------------------------
> WD=~/linux2
> KE=vmlinuz
> RO=hda7

> pushd ~

>   [ "$WD" = "" ] && echo "Oops!" && exit 16
>   [ ! -d "$WD" ] && evdo "mkdir -p $WD"
>   [ ! -d "$WD" ] && echo "Oops!" && exit 16

>   evdo "grep $WD < /etc/fstab > /dev/null"      &&
>   evdo "grep $WD < /etc/mtab  > /dev/null"      ||
>   evdo "mount $WD"

> popd

> [ "$WD" = "/root/linux2" ] &&
>  evdo "rm -rf $WD/*"

> pushd $WD

>   evdo "cp -aPx /    ."                 &&
>   evdo "cp -aPx /usr ."                 &&
>   evdo "cp -aPx /var ."                 &&
>   evdo "rdev ./boot/$KE ./dev/$RO"      &&
>   evdo "lilo"                           &&
>   evdo "rm ./etc/lilo.conf"             &&
>   echo "sed ..."                        &&
>   cat /etc/fstab                | \
>         grep -v /var            | \
>         grep -v /usr            | \
>         grep -v /root/linux2    | \
>         sed s/"hda1     "/"$RO  "/g > ./etc/fstab

> popd
> --------------------- end of script ------------------------

I forgot the evdo script:

--------------------------- begin of script --------------------
echo $*
echo $* | bash -s
----------------------------- end of script --------------------

 
 
 

How to transfer the root file system

Post by Dean Thompso » Tue, 17 Apr 2001 01:24:46


Hi!,

Quote:> No every thing in the / partitions. which means /dev/sda1 , has to be
> transfer to /dev/rd/c0d0p1.

Okay, well don't talk raw partitions because you will get yourself into
trouble.  I would suggest the following procedure:

  * Create the partition "/" on the RAID device
  * Make the file system on it
  * Create a mount point on your working systemf for the RAID
  * Below shows how I would do the copy:



                                            partition name for the RAID
                                            array. (probably sdb1)




This will copy the / partition and all directories which are on this partition
across to /mnt/raid (which is the / of the new system)

Note, that this only copies the files, bnot the boot block.  You will have to
do that with the help of a boot disk or convincing LILO to write to the new
boot sector.  This will also display a list of files that it is copying to the
other system.  You can remove this by taking out the "v" option in the tar
xvf.  The "l" option means stick to the "/" disk and the "-p" means preserve
the ownership of the files.

Additionally, make sure to change the files which affect the mounting of the
disks as well due to the fact that mount points will change.

See ya

Dean Thompson

--
+____________________________+____________________________________________+

| Bach. Computing (Hons)     | ICQ     - 45191180                         |
| PhD Student                | Office  - <Off-Campus>                     |
| School Comp.Sci & Soft.Eng | Phone   - +61 3 9903 2787 (Gen. Office)    |
| MONASH (Caulfield Campus)  | Fax     - +61 3 9903 1077                  |
| Melbourne, Australia       |                                            |
+----------------------------+--------------------------------------------+

 
 
 

1. How to transfer the root file system

Hi All
I have install redhat 6.2 with the kernel 2.2.17-4. Now I need to transfer
the entire os to another disk arry with the same system. The reason being
for that is I had problem with mylex 352 raid card. I have installed &
compiled 2.2.17-4 in order to get the drivers by connecting an external HD.
Now I need to transfer the OS inorder to boot from DISK ARRY.
How yo transfer, Can I use dd command dd if=/dev/sda1 of=/dev/rd/c0d0p1 ?,
Or with any other option?. The root partition of both drives are different
size. Or can I use dd if=/dev/sda1 of=/dev/rd/c0d0p1 conv=notrunc.
Please advice

Thanks in Advance
Thave

2. patch numbering

3. QUESTION: transferring files between file systems???

4. the finger command

5. Toshiba 420CDT and Xfree86 4.1.0

6. Kernel Memory Utilization

7. Enhanced Filing system - file system like DEC Advanced File system for Linux

8. root disk file system and nfs server from boot/root disks.

9. root disk file system type and nfs server from boot/root disks.

10. root disk file system and nfs server from boot/root floppies.

11. root file system above >1024 limit with System Commander?