I accidentally used sgdisk -R=/dev/sdb /dev/sda instead of sgdisk -R=/dev/sda /dev/sdb after replacing a broken drive in a raid. Can I recover from this or is all data lost now?

  • As long as you haven't rebooted, the old partition setup should still be in memory. (Can't you still access your files?) Also, is this a 2-disk RAID1?
    – derobert
    Jul 24, 2014 at 15:00
  • 2-disk raid1 yes, I have not rebooted but I'm in a rescue system and have not mounted the drives.
    – shibuyaku
    Jul 24, 2014 at 15:05
  • 1
    Oh... Without the drives mounted, it may not be loaded in memory :-( Check /proc/partitions to see if the partitions are there. Otherwise, it's still recoverable, just harder, you need to figure out the old partitioning. There are tools such as testdisk to scan the disk and attempt to locate them.
    – derobert
    Jul 24, 2014 at 15:06
  • Partitions are there. I got all the "start" and "size" values and copied them somewhere safe. //Edit (+hoping not to break site rules): I feel like handing this over to a professional. Are your interested or recommend someone, derobert? Now I'll try and go into this direction:unix.stackexchange.com/questions/93681/…
    – shibuyaku
    Jul 24, 2014 at 15:19
  • I'm unfortunately not available. I'd suggest asking in chat, but I'm not sure you have enough rep network-wide to join chat :-(
    – derobert
    Jul 24, 2014 at 15:32


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.