Make a copy of a unix HDD


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Make a copy of a unix HDD
# 1  
Old 03-20-2007
Make a copy of a unix HDD

i have this HDD with SCO 5.0.6 and i'm getting this errors
WARNING: wd0: Error on fixed disk dev 1/42, block=4829, cmd=0x000000C8
Sun Mar 11 05:50:08 2007
status=0x00000040, LBA sector=1285723, cylinder/head=5022/0
WARNING: wd0: Error on fixed disk dev 1/42, block=4829, cmd=0x000000C8
status=0x00000040, LBA sector=1285723, cylinder/head=5022/0
WARNING: wd0: Error on fixed disk dev 1/42, block=4829, cmd=0x000000C8
status=0x00000040, LBA sector=1285723, cylinder/head=5022/0

I need to be able to make a copy of this HDD into another one so i dont have to reinstall everything ,

Can anyone of you guys let me know what would be the best software to get this done,

thanks a lot
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy directories in make file

LD:=C:/WindRiver/diab/5.9.3.0/WIN32/bin/dld.exe CFILES:=$(wildcard *.c) OBJFILES:=$(subst .c,.o, $(CFILES)) OBJ_PATH:=$(PRJ_PATH)/out/ ADDOBJFILES := $(addprefix $(OBJ_PATH),$(OBJFILES)) FILES:=C:/EB/tresos/workspace/Test_Spi/output/src copyfiles: cp ... (3 Replies)
Discussion started by: ushacy
3 Replies

2. AIX

IBM AIX Internal HDD vs SAN HDD and Oracle

Hi Folks, I am facing an issue with the performance. P4 with 1 processor and 16 GB RAM and SAN HDD = Oracle report takes 25 minutes P5 with 2 processors and 16 GB RAM internall HDD with LPAR = Oracle Report takes 1 hour 15 minutes ( please note I have assigned all the max processors and... (7 Replies)
Discussion started by: filosophizer
7 Replies

3. Solaris

NTFS HDD readable from UNIX

I have somehow taken on the collateral duties of System Administrator for our small internal network. At current we have one main file server with 48 SATA swappable drives under the Solaris 10 OS. My question is this. Our analysts are bringing back data from the field in Windows formatted... (8 Replies)
Discussion started by: cbrowne20
8 Replies

4. Shell Programming and Scripting

How to make copy work faster

I am trying to copy a folder which contains a list of C executables. It takes 2 mins for completion,where as the entire script takes only 3 more minutes for other process. Is there a way to copy the folder faster so that the performance of the script will improve? (2 Replies)
Discussion started by: prasperl
2 Replies

5. UNIX for Dummies Questions & Answers

How to copy my system hdd usb stick from 4GB to 8GB ?

Hi, my router is my Linux embedded device. I have system installed on HDD 4GB usb stick, part1 swap, part2 /opt , part3 data. I need to copy my system to new HDD 8GB usb stick. What is a way for 4GB > 4GB HDD and what for 4GB > 8GB As I remeber, I can copy image of my 4GB HDD usb stick... (7 Replies)
Discussion started by: jack2
7 Replies

6. UNIX for Dummies Questions & Answers

Old HDD copy to new HDD ? im lost...

Over the last few months the HDD spins louder and louder, so I fiqured its time to replace the HDD. Its been running 24/7/365 since 98 :eek:. yes i said since 98 :D I have an IBM system 43P Model 240. 233 MHz. running AIX Version 4. The current HDD is an IBM DGHS COMP IEC -950 FRU PN#... (5 Replies)
Discussion started by: Chevy89rocks
5 Replies

7. UNIX for Dummies Questions & Answers

How to make a FreeBSD hdd writable from WinXP?

Hey, I was wondering how I can write/edit files on my FreeBSD hdd from windows XP. I specifically need to fix a change I made to /boot/defaults/loader.conf that made it impossible to boot into my FreeBSD hdd. It's a simple fix, but since I can't boot into FreeBSD, I have to fix it from my Windows... (2 Replies)
Discussion started by: Xandor
2 Replies

8. Filesystems, Disks and Memory

Unix not Booting after defect HDD

Hi there, Here I have an old HP LC3 server from a client of ours. The server was running in Raid1 Mirror mode. Yesterday the server didn't boot anymore and now I have concluded that 1 drive is damaged. I pulled it out so it can boot from the "good" one. Unfortuanally this didn't work. I... (3 Replies)
Discussion started by: severt
3 Replies

9. Solaris

Unix not recognising new HDD

I've just replaced the secondary disk drive (was 4 Gb) with a Seagate Barracuda 7200 200 Gb. However the OS seems to think this is only 500 Mb and a spin speed of 5400, although it correct recognises the drive as Seagate ST3200822A. I take it that it still thinks the old drive is attached. How... (5 Replies)
Discussion started by: wiggiesworld
5 Replies

10. UNIX for Advanced & Expert Users

SCO UNIX HDD full backup

HI ALL, I need to backup HDD with SCO UNIX. I need to have a full functionaly backup of this hard disk. Does anybody have any tool or subsription how to do it. I tried some SW, but after when I tried to use this copy of my original disk "can not find a root directory". Thanks in advance. (1 Reply)
Discussion started by: jardas
1 Replies
Login or Register to Ask a Question
SG_WRITE_LONG(8)						     SG3_UTILS							  SG_WRITE_LONG(8)

NAME
sg_write_long - send the SCSI WRITE LONG command SYNOPSIS
sg_write_long [--16] [--cor_dis] [--help] [--in=IF] [--lba=LBA] [--pblock] [--verbose] [--version] [--wr_uncor] [--xfer_len=BTL] DEVICE DESCRIPTION
Send the SCSI WRITE LONG (10 or 16 byte) command to DEVICE. The buffer to be written to the DEVICE is filled with 0xff bytes or read from the IF file. This buffer includes the logical data (e.g. 512 bytes) and the ECC bytes. This utility can be used to generate a MEDIUM ERROR at a specific logical block address. This can be useful for testing error handling. Prior to such a test, the sg_dd utility could be used to copy the original contents of the logical block address to some safe location. After the test the sg_dd utility could be used to write back the original contents of the logical block address. An alternate strategy would be to read the "long" contents of the logical block address with sg_read_long utility prior to testing and restore it with this util- ity after testing. Take care: If recoverable errors are being injected (e.g. only one or a few bits changed so that the ECC is able to correct the data) then care should be taken with the settings in the "read write error recovery" mode page. Specifically if the ARRE (for reads) and/or AWRE (for writes) are set then recovered errors will cause the lba to be reassigned (and the old location to be added to the grown defect list (PLIST)). This is not easily reversed and uses (one of the finite number of) the spare sectors set aside for this purpose. If in doubt it is probably safest to clear the ARRE and AWRE bits. These bits can be checked and modified with the sdparm utility. For example: "sdparm -c AWRE,ARRE /dev/sda" will clear the bits until the disk is power cycled. OPTIONS
Arguments to long options are mandatory for short options as well. -S, --16 send a SCSI WRITE LONG (16) command to DEVICE. The default action (in the absence of this option) is to send a SCSI WRITE LONG (10) command. -c, --cor_dis sets the correction disabled (i.e 'COR_DIS') bit. This inhibits various other mechanisms such as automatic block reallocation, error recovery and various informational exception conditions being triggered. This bit is relatively new in SBC-3 . -h, --help output the usage message then exit. -i, --in=IF read data (binary) from file named IF and use it for the SCSI WRITE LONG command. If IF is "-" then stdin is read. If this option is not given then 0xff bytes are used as fill. -l, --lba=LBA where LBA is the logical block address of the sector to overwrite. Defaults to lba 0 which is a dangerous block to overwrite on a disk that is in use. Assumed to be in decimal unless prefixed with '0x' or has a trailing 'h'. If LBA is larger than can fit in 32 bits then the --16 option should be used. -p, --pblock sets the physical block (i.e 'PBLOCK') bit. This instructs DEVICE to use the given data (unless --wr_uncor is also given) to write to the physical block specified by LBA. The default action is to write to the logical block corresponding to the given lba. This bit is relatively new in SBC-3 . -v, --verbose increase the degree of verbosity (debug messages). -V, --version output version string then exit. -w, --wr_uncor sets the "write uncorrected" (i.e 'WR_UNCOR') bit. This instructs the DEVICE to flag the given lba (or the physical block that con- tains it if --pblock is also given) as having an unrecoverable error associated with it. Note: no data is transferred to DEVICE, other than the command (i.e. the cdb). In the absence of this option, the default action is to use the provided data or 0xff bytes (--xfer_len=BTL in length) and write it to DEVICE. This bit is relatively new in SBC-3 . -x, --xfer_len=BTL where BTL is the byte transfer length (default to 520). If the given value (or the default) does not match the "long" block size of the device, nothing is written to DEVICE and the appropriate xfer_len value may be deduced from the error response which is printed (to stderr). NOTES
Various numeric arguments (e.g. LBA) may include multiplicative suffixes or be given in hexadecimal. See the "NUMERIC ARGUMENTS" section in the sg3_utils(8) man page. The 10 byte SCSI WRITE LONG command limits the logical block address to a 32 bit quantity. For larger LBAs use the --16 option for the SCSI WRITE LONG (16) command. EXAMPLES
This section outlines setting up a block with corrupted data, checking the error condition, then restoring useful contents to that sector. First, if the data in a sector is important, save it with the sg_read_long utility: sg_read_long --lba=0x1234 --out=0x1234_1.img -x BTL /dev/sda This utility may need to be executed several time in order to determine what the correct value for BTL is. Next use this utility to "cor- rupt" that sector. That might be done with: sg_write_long --lba=0x1234 -x BTL /dev/sda This will write a sector (and ECC data) of 0xff bytes. Some disks may reject this (at least one of the author's does). Another approach is to copy the 0x1234_1.img file (to 0x1234_2.img in this example) and change some values with a hex editor. Then write the changed image with: sg_write_long --lba=0x1234 --in=0x1234_2.img -x BTL /dev/sda Yet another approach is to use the --wr_uncor option, if supported: sg_write_long --lba=0x1234 --wr_uncor /dev/sda Next we use the sg_dd utility to check that the sector is corrupted. Here is an example: sg_dd if=/dev/sda blk_sgio=1 skip=0x1234 of=. bs=512 count=1 verbose=4 Notice that the "blk_sgio=1" option is given. This is to make sure that the sector is read (and no others) and the error is fully reported. The "blk_sgio=1" option causes the SG_IO ioctl to be used by sg_dd rather than the block subsystem. Finally we should restore sector 0x1234 to a non-corrupted state. A sector full of zeroes could be written with: sg_dd if=/dev/zero of=/dev/sda blk_sgio=1 seek=0x1234 bs=512 count=1 This will result in a sector (block) with 512 bytes of 0x0 without a MEDIUM ERROR since the ECC and associated data will be regenerated and thus well formed. The 'blk_sgio=1' option is even more important in this case as it may stop the block subsystem doing a read before write (since the read will most likely fail). Another approach is to write back the original contents: sg_write_long --lba=0x1234 --in=0x1234_1.img -x BTL /dev/sda EXIT STATUS
The exit status of sg_write_long is 0 when it is successful. Otherwise see the sg3_utils(8) man page. AUTHORS
Written by Saeed Bishara. Further work by Douglas Gilbert. REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2004-2009 Douglas Gilbert This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
sg_read_long, sg_dd (both in sg3_utils), sdparm(sdparm) sg3_utils-1.27 March 2009 SG_WRITE_LONG(8)