Attempting to create HDD replicator

Hi Guys,

First time post but looking to design a HDD replication device. Basically what I need it to do is have 6 HDD/SSDs connected to a motherboard. I will likely have openSUSE 13.2 but not definitely that as of yet. The issue I am having is that this needs to be as user friendly as possible. As in the typing needed, what I want to set it up with is having SATA 0 the primary which has 5 different .iso images and the other 5 SATA connections will be connected and have the .iso written to them, i.e. 1 .iso to SATA 1, a different one to SATA 2 etc…

I was thinking of making it so that I can hot swap the HDD out and when you insert a blank one you just have to click one button (likely to be done by a single USB button). The issue I am having in planning is making it so thay SATA 1 will always write the relevant .iso to the HDD/SSD. The disk are likely to never be more than 250GB in size, except the Primary.

Anybody got any advice in how to force a SATA port to always have the same information written to it?

Thanks in advance.

Requires testing, but…

Linux in general uses dd to do block replication and is likely the fastest tool you’ll ever find.
When you define the source and target, you use the same identifiers described in /dev. Some identifiers describe by a specific written and unique ID, but at least one is tied to the disk controller (which should remain constant when disks are swapped).

Building the command to execute your copying/cloning is the main functionality. How you expose that to the User is up to you… You can simply have the User execute the scripts directly or build a GUI interface with buttons that execute specific scripts.

TSU

Apologies for the delay in replying.

So if this is the case could I run the following command:

sudo dd if=/home/user/Downloads/filename.iso of=/dev/??? bs=512 conv=noerror,sync

Where the question marks are the destination HDD. Would this actually work or would this just not work? Also what speeds are we talking if we are using SATA II technology from dd to do block replication?

On 2015-09-14 13:56, Mike Charlie wrote:

> So if this is the case could I run the following command:
>


> sudo dd if=/home/user/Downloads/filename.iso of=/dev/??? bs=512 conv=noerror,sync

> Where the question marks are the destination HDD. Would this actually
> work or would this just not work? Also what speeds are we talking if we
> are using SATA II technology from dd to do block replication?

Yes, it should work. I would use a much bigger bs size, though.
Experiment with sizes till you hit the sweet spot for speed, which will
be close to the maximum theoretical speed for your hardware combination.

If the source may have errors, then I would use dd_rescue or ddrescue
(they are different). It gets the same speed if there are no errors.

One comment: it is not really an ISO. Those are images following a
specific format used on CDs and DVDs. You are using simply disk images,
so the correct extension would be .img.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Yes should work if the iso is a bootable image. I do something like this to make bootable USB drives from the install ISOs. I simply use cp to copy the iso image to the device. NOT a partition on the device. This works fine. dd is a bit faster but cp is easier to remember the parameters.

dd is often used to backup partition or whole drives. It does not care it will take any binary image and copy to any device/partition you want. You do have to take care that the output goes to the right place or you can zap things you did not want to. It does not protect you from shooting your own foot.

Right so now the main question is how do I identify which SATA Port relates to which HDD. I have connected to a system and attempted to run a cat on /dev/sda it comes back with random lines of non-sense as expected. But how would I get the identifiers for one of the HDD?

I have also discovered that I will need to use a SATA to IDE converter for a couple of HDD’s. I am right in saying this should not be an issue correct?

Well; mixing SATA and IDE drives can have issues in that they my not show up in the BIOS in the same order as expected. so it is most important you use UUID or by ID since /dev/sdX# notation may change.

The actual connection on the MB are numbered but boot order can make a difference

In the OS fdisk -l should list all drive and there names and order size etc. Partition type may be incorrect if GPT partitioning is used. use gdisk /dev/sdaX to show gpt partitioned disks accuratly

Right ok so had a look at that and will be doing testing to see if I can identify it correctly. The next problem I have is with the IDE PATA drives. Is there anyway other than rebooting the computer that will allow me to add/remove the PATA drives, i.e. commands. I have heard about commands to power down the drive, which will therefore stop the chances of corruption when removing the drives now I would just need a command to power up a PATA drive. This should allow me to “hot swap” the drives, as in insert drive click a button to run the script to power it on and then use it, once finished click another button to run script to power off and then it will be removable.

Hot swap requires special hardware carriers

It is not recommended that you hot swap with normal hardware

Nope. Hot swapping requires hot swapping hardware.

Can you define the hardware you mean? Is this like backplanes on hot swap bays or is this something I am unaware of.

You need hot swap bays yes then read the manuals for the hardware. AFAIK there is no generic solution it all depends on the hardware

Lets say I do get hardware that is compatible. Is there a command to get a PATA drive to mount after a computer has been launched?

If there is then I think I will have solved everything for this and will be able to create the machine.

Thanks

I am not sure that can be answered here. Those hot swappable devices are mostly incorporated in hardware/firmware RAID environments (possibly completely self governing, thus the system will not even know they are there and only see the resulting simulated mass-storage devices).

Thus, as said, it depends first on the hardware if the system gets some signal that there is a new mass-storage device on the PATA bus (like happens on USB). And I have no idea if the Kernel is able to handle such an event and when yes, in what way. On USB it then informs udev, which will use the USB parameters got from the device and when it is mass-storage (see the udev rules) will see that the device files (like /dev/sdX) are created. After that, it must be checked if a/several, and when yes what type of, file system(s) is/are on the device or it’s partitions. After that mounting of those file systems is possible.