Clone system disk to larger disk
#1
Clone system disk to larger disk
I have a 4 gig system disk that is 98% full.  I want to copy the entire contents to a larger 73gig drive.  The contents is irix and all my apps.

What is the best way to do this instead of reinstalling everything’s no from scratch.

Octane 2x600mhz R14000 Octane2 dual head V12 / V10, 7 gig Ram
Octane 2x250mhz R10000 2gig ram, MXE, Digital Video, MSCSI, Jaleo
1600SW O2 400mhz R12000 O2, 1gig Ram AV1  - 250gig Media' raid
Indy 180mhz R5000 Indy XZ 256mb ram
Indigo2 200mhz R4400 Extreme…….Under Construction
Dell T7600 dual 3.5 Xeon, 512 gb ram, Quadro K6000 + Tesla k20 - DaVinci Resolve Studio Editing
Dell T5500 dual 3.2 Xeon, 72gb ram, Quadro 6000 + Tesla C2075 - DaVinci Resolve Studio Cutting
Intel i7-990x 3.46GHz Extreme 6 core / Quadro 5000 & 2 x Tesla C2075 / 24gig Ram inside an SGI 320vw case
bjames
Tezro

Trade Count: (0)
Posts: 384
Threads: 109
Joined: Aug 2018
Find Reply
11-24-2018, 03:42 AM
#2
RE: Clone system disk to larger disk
insert second disk, "fx" it to be a root disk, run this script (as in save it, name it "clone", as root do "./clone 2" if your new disk will have scsi id of 2, then type 0 if its on scsi controller 0):


Code:
#!/bin/sh
# program to copy root & usr partitions and create a new bootable disk
# Note that this script is limited to SCSI drives, and only those
# on controller 2.
# It makes the root & usr filesystem on partition 0 & 6 for destination drive
# and install sash, ide & fx in the volume header of  the destination drive.

if [ $# -eq 0 ]
then
       echo "Usage $0 [disk_number]"
       exit 1
elif [ $1 -eq 1 ]
then
       echo "The disk number needs to be greater than 1."
       exit 1
elif [ $1 -le 1 ]
then
       echo "The disk number needs to be greater than 1."
       exit 1
else
       NUM=$1
fi

echo "\nSource SCSI (system)disk 1"
echo "\nDestination SCSI controller:  \c"
read SCSI_C
echo "\nDestination SCSI Controller channel "$SCSI_C" disk "$NUM""
echo "\007OK? (n)\c"
       read answer
       case "$answer" {
       y|Y|yes|Yes|YES) ;;
       *) echo "\007\n\nAbort"; exit 1;;
       }


echo "\nChecking SCSI disk"$NUM".."
hinv -c disk | grep -s "unit $NUM on SCSI controller $SCSI_C" > /dev/null 2>&1
if [ $? -ne 0 ]
then echo SCSI disk $NUM not found on controller $SCSI_C
       exit 1
fi

(prtvtoc -s -h /dev/rdsk/dks"$SCSI_C"d"$NUM"vol | grep "0.*xfs" ) > /dev/null 2>&1
if [ $? != 0 ]
then
       echo "reformat disk $NUM on SCSI controller $SCSI_C\n"
echo "for a system disk (no partition 0 found)"
       exit 1
fi

/etc/fsstat /dev/dsk/dks"$SCSI_C"d"$NUM"s7 > /dev/null 2>&1
s7=$?
/etc/fsstat /dev/dsk/dks"$SCSI_C"d"$NUM"s6 > /dev/null 2>&1
s6=$?
/etc/fsstat /dev/dsk/dks"$SCSI_C"d"$NUM"s0 > /dev/null 2>&1
s0=$?
if [ $s7 -ne 3 -o $s6 -ne 3 -o $s0 -ne 3 ]
then
       echo "\007SCSI controller $SCSI_C disk $NUM appears to\n"
echo "have a valid filesystem, overwrite it? (n)\c"
       read answer
       case "$answer" {
       y|Y|yes|Yes|YES) ;;
       *) echo Disk $NUM not added; exit 1;;
       }
fi
#-------------------------------------------------

echo "\nStart disk clone..."
umount /d
mkdir /d
mkfs -d name=/dev/rdsk/dks"$SCSI_C"d"$NUM"s0 -l internal,size=2048b -b size=1k
labelit /dev/rdsk/dks"$SCSI_C"d"$NUM"s0 / sgi
mount /dev/dsk/dks"$SCSI_C"d"$NUM"s0 /d
df -k
echo "\ncopy root partition..."
cd /; xfsdump -l 0 -J - / | (cd /d; xfsrestore - .)

fsstat /dev/usr 1> /dev/null 2>&1
stat=$?
if [ $stat = 2 ]
then
       mkdir /d/usr
       mkfs -d name=/dev/rdsk/dks"$SCSI_C"d"$NUM"s6 -l internal,size=2048b -b
size=1k
       labelit /dev/rdsk/dks"$SCSI_C"d"$NUM"s6 /usr sgi
       mount /dev/dsk/dks"$SCSI_C"d"$NUM"s6 /d/usr
       df -k
       echo "\ncopy usr partition..."
       cd /usr; xfsdump -l 0 -J - /usr | (cd /d/usr; xfsrestore - .)
fi

echo "\ninstalling sash, ide & fx in volume header....."
if [ ! -r /stand/sash ]; then /etc/dvhtool -v get sash /stand/sash /dev/rdsk/dks0d1vh ;fi
if [ ! -r /stand/fx   ]; then /etc/dvhtool -v get fx   /stand/fx   /dev/rdsk/dks0d1vh ;fi
if [ ! -r /stand/ide  ]; then /etc/dvhtool -v get ide  /stand/ide  /dev/rdsk/dks0d1vh ;fi

/etc/dvhtool -v c /stand/sash sash /dev/rdsk/dks"$SCSI_C"d"$NUM"vh
/etc/dvhtool -v c /stand/ide ide /dev/rdsk/dks"$SCSI_C"d"$NUM"vh
/etc/dvhtool -v c /stand/fx fx /dev/rdsk/dks"$SCSI_C"d"$NUM"vh
echo "\nNew disk number SCSI:"$SCSI_C" disk:"$NUM" ready to use."

echo "\nDONE....."
exit 0
gijoe77
Tezro

Trade Count: (1)
Posts: 644
Threads: 34
Joined: Jun 2018
Find Reply
11-24-2018, 04:50 AM
#3
RE: Clone system disk to larger disk
Is this still the suggested method for disk cloning?

Octane2 O2plus O2 
pcar
Octane

Trade Count: (1)
Posts: 73
Threads: 8
Joined: Mar 2019
Find Reply
05-05-2019, 02:04 AM
#4
RE: Clone system disk to larger disk
Yes. Xfsdump/xfsrestore is the way to go. It's not hard to do with a few basic commands (fx, mkfs, and xfsdump | xfsrestore), but I assume this script will work too.
callahan
Octane

Trade Count: (0)
Posts: 147
Threads: 20
Joined: Dec 2018
Location: East Coast, USA
Find Reply
05-05-2019, 02:08 AM
#5
RE: Clone system disk to larger disk
This process worked perfectly, thanks all!

Octane2 O2plus O2 
pcar
Octane

Trade Count: (1)
Posts: 73
Threads: 8
Joined: Mar 2019
Find Reply
05-08-2019, 08:44 PM
#6
RE: Clone system disk to larger disk
I cloned my hard disk to a SCSI2SD for my Indy without any problem. Now it works a little bit more silent.

Thanks!!!

Indigo Indy Indigo2 R10000/IMPACT O2 O2 Octane2 Fuel 1600SW 1600SW
Titox
Octane

Trade Count: (0)
Posts: 61
Threads: 1
Joined: May 2018
Location: Spain
Find Reply
05-09-2019, 07:12 AM
#7
RE: Clone system disk to larger disk
Thanks!!!I will try it later.
7077115292
O2

Trade Count: (0)
Posts: 2
Threads: 1
Joined: May 2019
Find Reply
05-16-2019, 04:46 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)