Menu

Cloning a disk that took part in an old RAID

cristis1
2010-03-16
2015-05-09
  • cristis1

    cristis1 - 2010-03-16

    Hello,

    I successfully used clonezilla before, but now I am blocked by the following problem:

    I have a hard drive that was a part in a RAID matrix. I want to clone a partition from this drive, but the drive doesn't get mounted by ntfs-3g:

    mount failed: Device or resource busy
    

    After having done some digging, I understood that the hard drives still has some RAID metadata. I think that because of this, the system tries to do something with it (while booting the live cd), and it doesn't release it.

    I see to possible directions:
    1) to delete the RAID metadata - I tried to do this but didn't succeed
    2) to modify the live cd boot process and to disable the part that "interprets" and "gets confused" by the RAID metadata that is found

    If I use a System Rescue CD, I don't have this problem (i.e. I can successfully mount the ntfs partitions using ntfs-3g).
    I forgot to mention that I don't want to lose the data from that harddrive.

    Thank you in advance,
    Best regards,
    Cristi.

     
  • Steven Shiau

    Steven Shiau - 2010-03-17

    Recently the issue about "mount failed: Device or resource busy" was fixed, you can give testing Clonezilla live 1.2.4-28 a try. If you are using Clonezilla SE, please try the unstable branch.

    Steven.

     
  • cristis1

    cristis1 - 2010-03-18

    Dear Steven,

    Thank you for your reply.

    I will give it a try.

    Best regards,
    Cristi.

     
  • cristis1

    cristis1 - 2010-03-22

    Dear Steven,

    I have tried with clonezilla-live-1.2.4-28-686 and I have the same problem.
    Have you got other leads?

    Thank you.
    Best regards,
    Crist.

     
  • Steven Shiau

    Steven Shiau - 2010-03-23

    Not really. Clonezilla does have some limitations about RAID.
    What's kind of RAID do you have? Software/FakeRAID? Hardware RAID?

    Steven.

     
  • cristis1

    cristis1 - 2010-03-28

    Dear Steven,

    I have read that Clonezilla does not support software RAID. But this is not a problem; as I said in the topic, the HDD took part from an old RAID matrix; it is no longer part of a RAID. But even if the RAID doesn't exist any more, the RAID metadata is still written on the HDD.

    I think that this is the reason why, when the linux boots sees this metadata and tries somehow to install the RAID support. 1) it doesn't succeed and 2) it "locks" the HDD, so other processes it cannot use it any more (i.e. mount). I have seen this while searching on the internet. While looking inside the directory structure, I see some "nvidia …" files, nvidia being the RAID controller.

    I think that the problem is that the kernel and/or settings from the live cd include the linux raid drivers/subsystems. As I am not a linux pro 1) I don't know exactly which applications handle RAID in linux and 2) how to disable them from the startup.

    Is it possible to do this?

    Thank you.
    Best regards,
    Cristi.

     
  • Steven Shiau

    Steven Shiau - 2010-03-29

    Maybe add "dmraid=false" in the boot parameters?
    Ref: http://wiki.debian.org/DebianInstaller/SataRaid

    Please let us know the results.

    Steven.

     
  • cristis1

    cristis1 - 2010-04-12

    Hello Steven,

    Victory! The correct boot parameter is "nodmraid" (without quotes). I have a software RAID 1 matrix (for mirroring), and I used Clonezilla successfully to create images. I will post the instructions. I see that there is a lot of people interested in using Clonezilla for RAID config, so maybe this is helpful. If you think so, you could put a link from the faq/wiki/etc.

    I have a RAID 1 setup (configured for mirroring, i.e. each HDDs is the exact copy of the other one). My RAID controller is a cheap, software one. However, I can still use Clonezilla to create restore images using the following steps:

    * when the live cd boots, press TAB, which will allow you to add additional boot params; add "nodmraid" (without quotes)
    * you will be able to see your HDDs (e.g. /dev/sda1 and /dev/sdb1)
    * chose a partition (or disk) that you want to "clone"
    * the destination should by: a third HDD, an USB device (stick or HDD), or SAMBA (Microsoft Networking)
    * proceed

    When restoring, you have to perform similar steps, but you need to restore the saved image to both HDD (or partitions). For example, I saved /dev/sda1. When restoring, I restore it first to /dev/sda1 and second to /dev/sdb1. Restart your system and that's it.

    Best regards,
    Cristian.

     
  • Alex

    Alex - 2010-04-19

    When you're backing up this software RAID, are you using partimage, dd, or something else?

    Thanks,

    -Alex

     
  • cristis1

    cristis1 - 2010-04-19

    I leave the default option. I didn't notice which one is used this way.

    Best regards,
    Cristian.

     
  • Alex

    Alex - 2010-04-19

    Would you please check your archive files? They are usually stored in "/home/partimag/". I think they will include the word "dd" if they were made by dd instead of partimag/partclone.

    Thanks,

    -Alex

     
  • cristis1

    cristis1 - 2010-04-20

    Dear Alex,

    I don't know if this helps:

    Image was saved by these Clonezilla-related packages:
    drbl-1.9.5-42 clonezilla-2.3.4-57 mkswap-uuid-0.1.1-1 drbl-partimage-0.6.8-1drbl drbl-ntfsprogs-2.0.0-4 partclone-0.1.9-5 drbl-chntpw-0.0.20040818-7 drbl-lzop-1.02-0.8drbl pigz-2.1.5-1drbl pbzip2-1.0.5-1drbl udpcast-20091031-1drbl

    I don't see dd anywhere in the image dir.

    Best regards,
    Cristian

     
  • Aldwin

    Aldwin - 2012-01-03

    Hi Christian and Steven,

    First of all, thanks for having this discussion. I'm really in need for such information dealing with RAID 1 Hard disks.

    My understanding is that the Saving and Restoring process have to be done using the "nodmraid" command right?
    I've tried the saving process with the "nodmraid" command on a RAID1 HD and it works. Now the question is, when I'm restoring it, can I restore to one HD and then RAID it? or should I restore the image to two HD and raid both of them ?

    Thank you,
    Aldwin

     
  • cristis1

    cristis1 - 2012-01-03

    Hello,

    I do it by restoring the image on both hard drives.

    Regards,
    Cristian.

     
  • Aldwin

    Aldwin - 2012-01-04

    Ok thank you, I tried restoring the image to one HD and reset/format the other HD. When I RAID both HD it'll automatically rebuild the data from HD1 to HD2

     
  • hansA

    hansA - 2012-12-21

    Thank you for this. I havn't tried it yet but I'm confident it will work. However, I'm sure about the following, because I've done that part many times. it's just like 'replacing a failed disk:
    Like kingaldwin says, it's not necessary to restore both disks from the image because the disks will sync anyway. The process is for example:

    restore /dev/sda
    copy the partition table from /dev/sda to /dev/sdb:

    sfdisk -d /dev/sda | sfdisk /dev/sdb
    

    Don't confuse the drives (you still have a backup, though)
    re-add partitions on /dev/sdb to the array, for example

    mdadm -add /dev/md0 /dev/sdb1
    mdadm -add /dev/md1 /dev/sdb2
    mdadm -add /dev/md2 /dev/sdb3

    Important
    Install grub on both disks after you've restored them. The procedure depends on whether you have grub legacy or grub2

    For grub legacy do

    root (hd0,0)
    setup (hd0)
    root (hd1,0)
    setup (hd1)
    quit

    For grub2 do

    grub-install /dev/sda
    grub-install /dev/sdb

     
  • hansA

    hansA - 2013-01-12

    I tried it now and it works like a charm.
    @songdrgn: as far as I've seen Clonezilla automatically chooses dd because neither partclone nor ntfsclone support the Linux Raid partition type. This takes more time but  the space consumed is about the same, thanks to gzip.

     
    • ljerome83

      ljerome83 - 2014-02-03

      Hello All,

      Does someone have done a clone of a RAID 1 HP SERVER ?
      I know it's a hardware raid, i have a message from clonezilla saying "unable to unmount partition" .
      is it supported by clonezilla ?
      Thanks in advance for your answers.

       
      • JorgeMOP

        JorgeMOP - 2015-04-20

        Hello to all,

        In matter, i clone a RAID1 (CCM/RetHat on HP server 1U with hardware for RAID) with clonezilla in normal process (Disk to Image) at that time, clonezilla show me two disk (sda and sdb), not one array. OK. I just clone sda (which is the same as sdb, is a RAID1), now i try to restore de image in other server with equal atributes, two disk with hardware RAID, same capacity, but always fail in boot or INIT, or the disk with the restored image comes out of the array and i can´t rebuild the array.

        anyone have this case.

        how its the process to save/restore an image of RAID1?

         
        • Steven Shiau

          Steven Shiau - 2015-05-09

          RAID is complicated to Clonezilla live. Some workarounds might work, but you might still have to let it rebuild, and deal with the boot loader and initramfs. Therefore, still there is no universal solution. It really depends and is complicated.

          Steven.

           
  • Steven Shiau

    Steven Shiau - 2014-02-06

    What's your device name for your RAID card?
    /dev/cciss/c0d0?
    /dev/sda?
    Or?

    Steven.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.