0

i wonder if/how i can stop my linux machine using the installed software raid, without loosing any data.

All information i found was about removing the superblock of any hdd, and this is o/c what i dont want.

so i wonder how i can archive my goal of booting w/o any read.

do i have to remove the device from the array, remove its superblock and dd the md-device to the sd-device, change the boot-configuration/fstab and be lucky? or do something else?

i really tried to google it up. but i failed just like my raid :/

Raid Setup:

raid1, 2 discs

/dev/md1, /dev/md3, array built of /dev/sd{a,b}1 and /dev/sd{a,b}3

please, i add this since i read it 100 times on other forums, dont tell me to use a hw-raid instead. this is not related to my question. thank you guys.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
thedanielhanke
  • 119
  • 1
  • 5
  • This is called [the XY problem](http://meta.stackexchange.com/q/66377/189912). Instead of breaking your RAID, you should fix the actual underlying problem (which is probably a bad hard drive). – Michael Hampton Mar 24 '13 at 03:39
  • yes probably you are right. that is what i tried for some time now, got unlucky. the pain is, that it breaks my webservices, and i already do have a backup. smartmon, hddchecks etc. do not show any errors.. + for my pure knowledge it would be fine to know anyway ;) – thedanielhanke Mar 24 '13 at 03:40
  • Is [this](http://serverfault.com/q/404870/126632) your problem? Perhaps you should update that question with any new information you might have (e.g. I'd like to see `smartctl` output for both disks). – Michael Hampton Mar 24 '13 at 03:43
  • That's not the complete output. You filtered it, with `grep`, and the interesting details are in the stuff you filtered. – Michael Hampton Mar 24 '13 at 03:49
  • (ok i will rerun the full scan an then post/update the question)did so, but as lucky as i am that you read/reply to my question, i spent weeks with writing informations, tweaking the madm (guided by some pros) and doing benchmarks.. i never had a machine this slow form time to time. hdparm for example takes 3 minutes to tell me it did read in 2 seconds.. – thedanielhanke Mar 24 '13 at 03:50
  • please wait 293 minutes for the test to complete. does a short one fit? dont know when the last one was run.. – thedanielhanke Mar 24 '13 at 03:53
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/8045/discussion-between-thedanielhanke-and-michael-hampton) – thedanielhanke Mar 24 '13 at 03:55
  • test runs, however, i am really! interested in my original question, about removing a device w/o data lost. – thedanielhanke Mar 24 '13 at 04:06
  • 1
    Could you rephrase the question? I am not sure what you want. You have x physical disks with or without a partition table which are combined to a mdraid RAID level n. And you want to have what? Just one disk that stores your data without redundancy? – Hauke Laging Mar 24 '13 at 05:35

1 Answers1

1

In my experience, an mdadm RAID-1 can be broken by umounting the partition, using mdadm to stop the array, then mounting either half of the partition in place of the array.

Furthermore, if you use fdisk to retag the two constituent partitions from type fd (Linux RAID autodetect) to type 83 (Linux), the kernel will not try to reassemble the (now-broken) RAID on the next reboot. Don't forget to update your fstab.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • AFAIK you are right about the kernel and the partition type but mdraid assembly isn't done by the kernel any more but by mdadm and that doesn't care about the partition type. This info is just from memory though, I haven't checked it. – Hauke Laging Mar 24 '13 at 19:38