1. OCAU Merchandise now available! Check out our 20th Anniversary Mugs, Classic Logo Shirts and much more! Discussion here.
    Dismiss Notice

How can I access files on a single drive from RAID1 set?

Discussion in 'Other Operating Systems' started by yanman, Jun 27, 2010.

  1. yanman

    yanman Member

    Joined:
    Jun 4, 2002
    Messages:
    6,601
    Location:
    Hobart
    Hey guys, I have 2 x 1.5TB drives that were from my old Ubuntu server. Together they were a RAID1 volume formatted with ext4.

    I've attached one of them to a VM and am using a Ubuntu DVD, booting into live mode and trying to access the drive so that I can copy the files onto a windows box.

    Can it be done?
     
  2. the-enigma

    the-enigma Member

    Joined:
    Mar 18, 2002
    Messages:
    1,728
    Location:
    BrisVegas
    RAID1 splits up blocks onto each drive. It doesn't put each file onto one drive itself, so you'll need both drives connected at once (or some other technical tomfoolery) to get files off.

    So in short, you need to hook up both drives, and mount the raid volume as normal, to get files off.


    Edit: The above is for RAID0, not RAID1. Ignore :)
     
    Last edited: Jun 28, 2010
  3. OP
    OP
    yanman

    yanman Member

    Joined:
    Jun 4, 2002
    Messages:
    6,601
    Location:
    Hobart
    Don't you mean RAID0? I did a google after posting it and found if I simply zero'd the superblock with mdadm then I could mount a single drive as a regular drive.
     
  4. Blinky

    Blinky Member

    Joined:
    Jul 4, 2001
    Messages:
    2,589
    Location:
    Brisbane CBD
    Yes I think he must mean that, cuz that's not right about raid1. Do you even need to wipe the superblock? Just bring it up as degraded.
     
  5. cs-cam

    cs-cam Member

    Joined:
    Oct 17, 2007
    Messages:
    742
    Location:
    Brisbane, QLD
    I would do this rather than messing with the drive. Less chance of accidently breaking things.
     
  6. the-enigma

    the-enigma Member

    Joined:
    Mar 18, 2002
    Messages:
    1,728
    Location:
    BrisVegas
    Aaah yep. My bad, I completely stuffed that up. Ignore my post.
     
  7. OP
    OP
    yanman

    yanman Member

    Joined:
    Jun 4, 2002
    Messages:
    6,601
    Location:
    Hobart
    How would I do that?

    The only reason I wasn't worried about messing with the array is that I wasn't going to be using it again. Ended up being so easy with the Ubuntu 10.4 live DVD! I just installed mdadm, wiped that superblock, then mounted the drive.
     
  8. Blinky

    Blinky Member

    Joined:
    Jul 4, 2001
    Messages:
    2,589
    Location:
    Brisbane CBD
    Specify the failed disk/partition as 'missing' (no quotes) instead of a path.
     
  9. OP
    OP
    yanman

    yanman Member

    Joined:
    Jun 4, 2002
    Messages:
    6,601
    Location:
    Hobart
    that's with mdadm I assume? i.e.

    Code:
    mdadm missing /dev/sda1 /dev/hda1
    ?
     
  10. Blinky

    Blinky Member

    Joined:
    Jul 4, 2001
    Messages:
    2,589
    Location:
    Brisbane CBD
    Yeah sort of, when you get define the array you have to tell it the number of members it should expect and therefore need to have corresponding entires. Replace the failed drive with 'missing'.
    So it would look more like:
    mdadm -Cv /dev/md6 -l1 -n2 /dev/sdc1 missing
    (this> --level=1 --raid-devices=2 is the same as -l & -n above)
    Use missing to replace as many real raid members which are not present (or missing) in the case of hot extras or higher levels of raid like raid6.

    Be aware that a -C or --create will probably spit the dummy as there is a preexisting superblock. It might be an -A while there is a readable superblock. If you've got mdadm installed the manpage will be of more help.
     
  11. OP
    OP
    yanman

    yanman Member

    Joined:
    Jun 4, 2002
    Messages:
    6,601
    Location:
    Hobart
    FCK!!!!!

    my files!! :sick: :sick: :Paranoid:

    I can't see any files on the NTFS drive!

    Okay this is what I did:
    - I have drive0 and drive2 assigned to a VM and booted Ubuntu 10.4 in Live mode
    - I erased superbit on drive0 which was formatted with ext4, then mounted it to check the files were all there
    - I shutdown the VM, removed drive2 from the VM, created an extended then NTFS partition on that and quick formatted
    - I attached that back to the VM and booted it
    - Mounted both drives so I had one ext4 with files, and one empty NTFS drive mounted
    - I moved all the files from ext4 drive to ntfs drive
    ...... took fcking ages, and eventually df -h showed that the NTFS drive was now full and the other empty
    - Shutdown the VM
    - Checked the NTFS drive in Windows and it's empty!! :sick:
    - Booted VM again to see and for some reason df -h shows it has data but I can't see any of it!

    wtf! please help :(
     

Share This Page

Advertisement: