LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-01-2014, 10:52 AM   #1
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Rep: Reputation: 7
Unable to mount former RAID hard drive


Hey all, I had a Linux server (white box) that had two 1TB hard drives in a RAID1 array. The motherboard went out (blown caps) so I scrounged the parts and set them on a shelf. I needed additional disk space in my OpenSUSE workstation so I took one of the drives and installed it. When I ran fdisk -l I saw the drive under /dev/sdc and /dev/sdc1 but I also saw it under /dev/md127 (the old array). I used fdisk to remove partitions and made a new partition of type 83 and using the entire disk but no joy; /dev/md127 is still there. I Googled this problem and as a fix I ran:

Code:
dd if=/dev/urandom of=/dev/sdc bs=1M
I rebooted my computer, ran fdisk -l again and all I saw was /dev/sdc. Yes! Well, no. I created a new partition on /dev/sdc and while I now have /dev/sdc1 I also have /dev/md127 again. I tried to mount /dev/sdc1 and I get this error:

Code:
linux-b8kj:/home/jobee # mount /dev/sdc1 /mnt/temp
mount: unknown filesystem type 'linux_raid_member'
linux-b8kj:/home/jobee #
I even tried mounting /dev/md127; at least it's a different error:

Code:
linux-b8kj:/home/jobee # mount /dev/md127 /mnt/temp
mount: /dev/md127 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/md127,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
linux-b8kj:/home/jobee #
Any ideas on what I can do to return this hard drive to a mountable state?

Thanks,

Joe B
 
Old 11-01-2014, 10:59 AM   #2
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Ok, I just found this:

Quote:
The simplest way to access that data is to assemble the raid device. In a RAID-1 volume, a single device is sufficient.

madadm -A /dev/sdc1
but when I run it I get this:

Code:
linux-b8kj:/home/jobee # mdadm -A /dev/sdc1
mdadm: device /dev/sdc1 exists but is not an md array.
linux-b8kj:/home/jobee #
I'm going to go do something else and check back here later...

Thanks,

Joe B
 
Old 11-02-2014, 07:12 AM   #3
dalai lama
LQ Newbie
 
Registered: Dec 2009
Location: Amsterdam
Distribution: CentOS
Posts: 19

Rep: Reputation: 0
Hi Joe,

What is it exactly now you are trying to do? First you dd'd the disk and after that you are trying to activate the mdadm partition?
Does cat /proc/mdstat stil list the partition on the disk? What does mdadm.conf say? Does it list the hard disk as a software raid device? If so you will need to remove it first with -f and -r option.

Robert
 
Old 11-02-2014, 08:21 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
I would guess that mdadm is trying to rebuild the array. Try this:

mdadm --stop /dev/md127
mdadm --zero-superblock /dev/sdc (Verify you are using the correct device ID)
 
Old 11-19-2014, 02:14 PM   #5
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Sorry for the slow responses; it's been pretty busy here. On a lighter note, my 2015 budget was approved in entirety.

dalai lama,
Quote:
What is it exactly now you are trying to do?
All I'm trying to do is get this 1TB hard drive in a condition where it can be used in my workstation (OpenSUSE 13.1)

Quote:
First you dd'd the disk and after that you are trying to activate the mdadm partition?
I did the dd thinking that would erase whatever is left on it that's preventing me from using the drive. The part about creating a one-drive array was something I read that was supposed to fix the problem

Quote:
Does cat /proc/mdstat stil list the partition on the disk?
Code:
linux-b8kj:/home/jobee # cat /proc/mdstat
Personalities : [raid1] 
unused devices: <none>
linux-b8kj:/home/jobee #
Quote:
What does mdadm.conf say?
Code:
linux-b8kj:/home/jobee # find / -iname mdadm.conf
find: ‘/var/run/user/1000/gvfs’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
linux-b8kj:/home/jobee #
Quote:
Does it list the hard disk as a software raid device? If so you will need to remove it first with -f and -r option.
See above

michaelk, I was able to run the stop command with no errors but the zero command, not so much:
Code:
linux-b8kj:/home/jobee # mdadm --zero-superblock /dev/sdc
mdadm: Unrecognised md component device - /dev/sdc
linux-b8kj:/home/jobee #
And sdc is the correct drive. Is there no way to just blank this drive so I can use it for other purposes?

Thanks,

Joe B

Last edited by jbruyet; 11-19-2014 at 02:19 PM.
 
Old 11-19-2014, 07:31 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Post the output of
mdadm --examine --verbose --scan
 
Old 11-21-2014, 05:59 PM   #7
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
michaelk, here's the output:

Code:
linux-b8kj:/home/jobee # mdadm --examine --verbose --scan
ARRAY /dev/md/0  level=raid1 metadata=1.2 num-devices=2 UUID=0fd71104:ab49def8:8ea16fc2:9bbff84e name=srvBackup:0
   devices=/dev/sdc1
linux-b8kj:/home/jobee #
Yep, srv-Backup is the server the drives came out of. I saw the /dev/md/0 so I took a look there. Here's what I saw:

Code:
linux-b8kj:/dev/md # ls -l
total 0
lrwxrwxrwx 1 root root 8 Nov 21 15:43 srvBackup:0 -> ../md127
linux-b8kj:/dev/md #
All this yatta yatta from installing one hard drive in my computer. Yow.

Thanks,

Joe B
 
Old 11-21-2014, 06:38 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
So try zeroing sdc1 vs sdc
 
Old 11-21-2014, 08:37 PM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Really, it is very hard to nuke a mdadm array beyond repair. I tried it as well for testing a backup procedure and it is really hard.

I am wondering something. You issued the dd command from /dev/random with a BS of 1M. This drive is 1 TB. That should have taken hours if not days to complete. First it is 1,000,000 blocks, secondly you asked for 10e9 random numbers. I didn't you hear complaining about it. So I really doubt if the writing was completed correctly.

My favorite way of nuking mdadm arrays:
Code:
dd if=/dev/zero of=/dev/sdc BS=100M
At the end you should see that about 1,000,000,000,000 bytes have been written. A bit more because of the 1024x1024x1024... yada yada.

Once you have seen that it is unlikely that the array survived that.

jlinkels
 
1 members found this post helpful.
Old 11-24-2014, 11:46 AM   #10
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
--> michaelk,
Code:
linux-b8kj:/home/jobee # mdadm --zero-superblock /dev/sdc1
mdadm: Couldn't open /dev/sdc1 for write - not zeroing
linux-b8kj:/home/jobee #
--> jlinkels, I will redo the dd per your parameters.

Thanks for the help,

Joe B
 
Old 11-24-2014, 05:14 PM   #11
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Thank you jlinkels:

Code:
linux-b8kj:/mnt/stuff/Test # ls -l
total 4
-rw-r--r-- 1 root root 29 Nov 24 15:13 hello.txt
linux-b8kj:/mnt/stuff/Test # cat hello.txt
This is only a test. Honest. linux-b8kj:/mnt/stuff/Test # 
linux-b8kj:/mnt/stuff/Test #
Looks like I can mount the drive, create folders and files and edit them.

Thanks again,

Joe B
 
Old 11-24-2014, 07:16 PM   #12
Soapm
Member
 
Registered: Dec 2012
Posts: 182

Rep: Reputation: Disabled
if you're trying to use the drive, no need doing the dd... that will take forever. Just create a new filesystem and it will overwrite the drive.

mkfs.ext4 /dev/sdc1

You may have to firse it if it see's the superblock. I think the force switch is -f
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mount a hard drive with RAID in it awrongline Linux - Newbie 5 07-20-2014 06:33 PM
[SOLVED] Unable to mount internal sata drive and external usb hard drive paulie_linux Linux - Desktop 1 06-25-2014 07:24 PM
[SOLVED] Unable to mount hard drive svenxix Linux - Hardware 3 02-11-2012 10:47 AM
Unable to Mount WD Hard Drive mosthigh Linux - Hardware 1 07-20-2011 06:03 AM
unable to mount hard drive marcusnerison Linux - Hardware 11 05-17-2008 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration