Is it possible to clone a SCSI drive to SCSI2SD
#11
RE: Is it possible to clone a SCSI drive to SCSI2SD
It's worth noting modern linux does NOT support IRIX XFS anymore, at least since 2013. I have no idea how Clonezilla works, but you gotta be careful with broad spectrum, dangerous recommendations like that, especially as modern linux doesn't support directory structure v1 or 2.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
03-23-2020, 10:32 PM
#12
RE: Is it possible to clone a SCSI drive to SCSI2SD
It appears that rumors of Linux's failure to support SGI XFS are exaggerated. I still need to do more testing, but I was able to fully manipulate an Indy HD and restore a SGI-created xfsrestore to what seems to be a partially-functioning state via linux. I haven't been able to get xfsdump to work yet.

My setup: Linux Mint 19.3 (the current distro, which by default included xfsprogs; I had to add xfsdump) on an Intel core i5 testbench with a PCI Adaptec 2940 SCSI adapter.

Really curious to see what particular problems others have run into in past testing. So far I have only attempted to work with disks created in Irix 6.5.
(This post was last modified: 03-25-2020, 12:53 AM by callahan.)
callahan
Octane

Trade Count: (0)
Posts: 147
Threads: 20
Joined: Dec 2018
Location: East Coast, USA
Find Reply
03-25-2020, 12:40 AM
#13
RE: Is it possible to clone a SCSI drive to SCSI2SD
I am only echoing what I saw in commit logs and what weblacky stated in his posts.

It's possible that he was only using directory structure v1, which we've confirmed doesn't work, or that his specific setup/config didn't work; but I have no way of verifying that. Furthermore, I have zero intention of testing it myself. If you can provide your xfsprogs version, xfs kernel module version etc. then it could potentially be a helpful milestone.

The reason I have zero intention of testing it myself, for the record, is because I don't own any PCI SCSI cards, and don't run Linux, nor do I have a particular desire to waste money or time on it.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
03-25-2020, 01:27 AM
#14
RE: Is it possible to clone a SCSI drive to SCSI2SD
For those who stumble across this post, there is an update with instructions for at least XFS v2 volumes here: https://forums.irixnet.org/thread-3301-p...l#pid23565

Also, fwiw, Raion was of course correct -- while modern linux could partially see the xfs images, I encountered more problems and gave up...until the post linked above.

Edit -- And weblacky was right too.
(This post was last modified: 12-20-2021, 10:25 PM by callahan.)
callahan
Octane

Trade Count: (0)
Posts: 147
Threads: 20
Joined: Dec 2018
Location: East Coast, USA
Find Reply
12-20-2021, 04:56 PM
#15
RE: Is it possible to clone a SCSI drive to SCSI2SD
None of the credit should go to me for the solution, because all I did was state objective facts that anyone can verify. I am glad that we are able to hearken back to this thread for information though.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-20-2021, 05:33 PM
#16
RE: Is it possible to clone a SCSI drive to SCSI2SD
Easier than pie with the below script I just did this actually. After fx my drive to root I just loaded the script everything and I mean everything is automatic after it’s done you can just swap it or even out it in a different machine.
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):

#!/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

O2 O2O2
mamed
Octane

Trade Count: (0)
Posts: 112
Threads: 29
Joined: Jan 2021
Location: Canada
Find Reply
01-03-2022, 06:50 AM
#17
RE: Is it possible to clone a SCSI drive to SCSI2SD
(01-03-2022, 06:50 AM)mamed Wrote:  Easier than pie with the below script I just did this actually. After fx my drive to root  I just loaded the script everything and I mean everything is automatic after it’s done you can just swap it or even out it in a different machine.
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):

#!/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


Only small comments I have are:

1. Please either probe or prompt for XFS block size as small disks should be using 512 while larger disks use 4096.
2. See about using DVHTOOL to also bring along IDE (diags) correctly.
weblacky
I play an SGI Doctor, on daytime TV.

Trade Count: (10)
Posts: 1,716
Threads: 88
Joined: Jan 2019
Location: Seattle, WA
Find Reply
01-03-2022, 07:02 AM
#18
RE: Is it possible to clone a SCSI drive to SCSI2SD
(01-03-2022, 07:02 AM)weblacky Wrote:  
(01-03-2022, 06:50 AM)mamed Wrote:  Easier than pie with the below script I just did this actually. After fx my drive to root  I just loaded the script everything and I mean everything is automatic after it’s done you can just swap it or even out it in a different machine.
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):

#!/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


Only small comments I have are:

1. Please either probe or prompt for XFS block size as small disks should be using 512 while larger disks use 4096.
2. See about using DVHTOOL to also bring along IDE (diags) correctly.
and how would we do that?Smile

O2 O2O2
mamed
Octane

Trade Count: (0)
Posts: 112
Threads: 29
Joined: Jan 2021
Location: Canada
Find Reply
01-03-2022, 03:52 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)