How to duplicate a drive in Unix?


 
Thread Tools Search this Thread
Special Forums Hardware Filesystems, Disks and Memory How to duplicate a drive in Unix?
# 8  
Old 02-27-2002
Heh, that's how I create ISO images to burn in Windows. I use mkisofs (I like it better than the windows program to create a CD), or cat /dev/hdb > /usr/lib/samba/tmp/cd_1.iso

Now I pull it to my Windows CD burner via Samba, and burn away!

Alas, I can't have my cd-burner attached to my Linux machine, since it's a portable, external that attaches to parallel port, and my version of Linux does not have a stable driver out for it...

Soon, hopefully, I'll have time (and energy!) to try fiddling with it...
# 9  
Old 03-12-2002
I just compiles myself a new fBSD4.4 kernel, and there was a 'parallel bus' there - I don't have any parallel devices (whatever happened to Centronics, I still have printer cables that take a Centronics in each end)

Have you tried FreeBSD?
It seems a shame not to be able to run an OS just for that reason!

FreeBSD can also, at least in theory, read ext2, so you don't need a new partition or anything (eh, I think my pants are on fire) Smilie - but you could give it a try - use MFS or something as rootdev?

Atle
# 10  
Old 03-12-2002
Quote:
Originally posted by DanielB

If you got 2 identical disks you could mirror them like this :
dd if=/dev/hda of=/dev/hdb
The problem with this method is that dd is a block-level copying tool. If your source disk contains some bad blocks, they will be copied exactly to the destination. In addition, if you are using a LVM to span a filesystem across multiple physical disks, the dd can get tricky. A better solution might be to use cpio, tar, or even a simple recursive copy.
# 11  
Old 03-29-2002
I usually use:
Code:
find /path/to/orig | cpio -pdmv /path/to/dest

Note that the lowest directory in your original tree will be recreated at the destination, so to move a home directory from /export/home/chuck to /home/chuck, you would use:
Code:
find /export/home/chuck | cpio -pdmv /home

I didn't know the cat trick, I like that Smilie
# 12  
Old 06-09-2004
Question

Hello,

First, I apologize in advance for bringing up a question that probably has been answer somewhere in the forum (I've been searching for hours and I finllay decided to post, I'm definitely a noob to UNIX, again sorry).


I am trying to do the same as the original poster, copy/mirror a drive (entire contents) for purpose of backup. Basically duplicate contents of an existing SCSI HardDrive running UNIX SCO Ver.5.0.6 to a new HD, then boot it with a newly backed-up drive to make sure that it works properly.

Reason for this exercise is to make sure that I have a working backup copy before I could setting up RAID or do other potentially stupid things.

I have been reading and sounds like "dd" or "cpio" would do the trick, but I like the simplicity of "dd" unless I misunderstood its functions. I'm a complete newb to UNIX so this could easily happen.

So, is this the path once the backup HD is installed and detected?
dd if=/dev/hda of=/dev/hdb
(where, hda = current drive, hdb = new drive)

If so, any risks or cautions of what not to do?? thank you!!!
# 13  
Old 09-23-2007
Drive Letters

This should have been answered 3 years ago by an expert.. shame shame

I'm fresh off the truck but I understand the importance of this question!

First, you are probably use to DOS designations like C: and D: etc., however, in FreeBSD your floppy drive is always FD0 and your hard drives (not the CD) are labeled ad0 ad1 ad4 ad6 (or higher or in between) depending on how they are attached to the system. Attached? like on the IDE controller, on a SATA controller, SCSI and the position they are assigned in bios. For me, finding out that a RAID is usually ar0 was helpful.

So where are your drives??? Simple, do this! at the prompt, type in

ls /dev <enter>

This is going to list all the devices attached to your system and their partitions (? I think).. On my server, I find an ad4 and an ad6 so I would use (hopefully, I'm going to try it here soon):

dd if=/dev/ad4 of=/dev/ad6

This because I want to copy the drive attached to the first controller to the second controller and I DO NOT care if it copies blocks marked as bad so long as the second drive doesn't "really" have bad sectors, it should be a perfect backup for what i want and easier than all the config and slicing ect.

Barry L. Salter
# 14  
Old 09-25-2007
The method that I use to accomplish a bit-by-bit copy of a SCO Openserver 5.0.7 SCSI disk is this:

First, create a small (say, 30 MB) DOS_16 partition on an empty disk. I found that Free Fdisk works great on large SCSI disks. Then format this partition from a bootable DOS floppy (I used MS_DOS ver 6.22); make the new DOS partition bootable by using the DOS "FORMAT C: /S" command. Copy the freeware version of Ranish Partition Manager (for DOS; I use version 2.40.00) to a new directory on this new DOS partition, as well as any other DOS utilities that suit you.

Next, proceed with a fresh install of SCO Openserver, and tell its install routine that you wish to keep the DOS_16 partition intact at the front of the disk, and use the remainder for Unix (and whatever else you wish).

Once SCO Openserver is installed, restart the PC and at the boot manager's "boot:" prompt, enter "dos" (no quotation marks), which will boot DOS from the DOS partition. Run Ranish Partition Manager, and use its D command to copy the entire disk to a second disk. (Play with the program first, to see how versatile and powerful it is. It can copy individual partitions, or an entire disk . . . and it's free.) It works nicely, and is fast, especially if you use EMM386, switch the processor to protected mode, and use DMPI before running Ranish. A 9 GB disk copy takes me less than 10 minutes.

I've used this method to clone a Unix disk a couple times after screwing up my SCO installation and it saves hours of install time.

Last edited by Russ Bellew; 10-03-2007 at 07:24 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

FTP from Widows to UNIX system - how to? ( was To not to duplicate)

Dear team , thanks for your support. I am trying to not to duplicate a thread if one is already there for what I am looking, which I am not able to figure out. Is it OK if I post the post the following question in new thread. --- What follows was in blue.. we are to avoid using colours as we want... (4 Replies)
Discussion started by: ar103081
4 Replies

2. Shell Programming and Scripting

Bash Script to find/sort/move images/duplicate images from USB drive

Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist... (1 Reply)
Discussion started by: JonaQuinn
1 Replies

3. UNIX for Dummies Questions & Answers

Need help to move .csv file from UNIX path to windows shared drive or c:\ drive

Hi Guys, Can any one help me on this. I need help to move .csv/.xls file from unix path to windows shared drive or c:\ drive? Regards, LKR (1 Reply)
Discussion started by: lakshmanraok117
1 Replies

4. UNIX for Dummies Questions & Answers

Duplicate column in unix file

Hello, I have a fixed width unix file with 2 columns containing the following data ZTXX_CTBR1-ZBRAN1 ZTXX_CTBR1-ZBRAN_DESC 01 CASH & CARRY 02 DRUGSTORE - RX 04 ... (4 Replies)
Discussion started by: chumsky
4 Replies

5. UNIX for Dummies Questions & Answers

Solaris 2.6 - Duplicate Filesystem to a larger slice(same drive)

One of our production systems has a slice called "oldslice" that periodically runs low on space during normal operation. We have minimum requirements for online data retention, and whoever sized this slice didn't give it much wiggle room, so it periodically runs low on space. I'm getting tired of... (1 Reply)
Discussion started by: the.gooch
1 Replies

6. UNIX for Dummies Questions & Answers

How to delete partial duplicate lines unix

hi :) I need to delete partial duplicate lines I have this in a file sihp8027,/opt/cf20,1980182 sihp8027,/opt/oracle/10gRelIIcd,155200016 sihp8027,/opt/oracle/10gRelIIcd,155200176 sihp8027,/var/opt/ERP,10376312 and need to leave it like this: sihp8027,/opt/cf20,1980182... (2 Replies)
Discussion started by: C|KiLLeR|S
2 Replies

7. UNIX for Advanced & Expert Users

RAM Drive in UNIX?

Hello, I will be processing 47000 zip files each of size 5.5 MB. Following operation will be performed for each zip file: 1. Unzip the file. 2. Read each text and binary file. 3. Preprocess the files. 4. Store the files in different tables in Oracle. 5. Delete the extracted... (7 Replies)
Discussion started by: joshivaibhav
7 Replies

8. UNIX for Dummies Questions & Answers

Sharing a Unix Drive Over The Internet ... but

I don't know if this can be done, otherwise, my project will come to a screeching halt. I have a SCO 5.0.5 machine connected to the internet with a static IP address. I need to be able to share a drive : /shareddrive I need to map to it from a windows machine: hence, what i'd like to... (3 Replies)
Discussion started by: gseyforth
3 Replies

9. UNIX for Dummies Questions & Answers

Tape Drive on Unix 7.1.1

I am trying to install a tape drive on this system (Unix 7.1.1) where will I start? 1. Do I need to load the driver on the on board scsi? How? 2. Is there a driver for the tape drive itself? Things done: 1. Terminated the device on the controller board. (4 Replies)
Discussion started by: a4tech
4 Replies

10. UNIX for Dummies Questions & Answers

unix on a small drive?

has any body put freebsd on a drive smaller than 80megs? (4 Replies)
Discussion started by: silverraindog
4 Replies
Login or Register to Ask a Question