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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-01-2014, 10:52 AM
|
#1
|
Member
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178
Rep:
|
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
|
|
|
11-01-2014, 10:59 AM
|
#2
|
Member
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178
Original Poster
Rep:
|
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
|
|
|
11-02-2014, 07:12 AM
|
#3
|
LQ Newbie
Registered: Dec 2009
Location: Amsterdam
Distribution: CentOS
Posts: 19
Rep:
|
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
|
|
|
11-02-2014, 08:21 AM
|
#4
|
Moderator
Registered: Aug 2002
Posts: 26,213
|
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)
|
|
|
11-19-2014, 02:14 PM
|
#5
|
Member
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178
Original Poster
Rep:
|
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.
|
|
|
11-19-2014, 07:31 PM
|
#6
|
Moderator
Registered: Aug 2002
Posts: 26,213
|
Post the output of
mdadm --examine --verbose --scan
|
|
|
11-21-2014, 05:59 PM
|
#7
|
Member
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178
Original Poster
Rep:
|
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
|
|
|
11-21-2014, 06:38 PM
|
#8
|
Moderator
Registered: Aug 2002
Posts: 26,213
|
So try zeroing sdc1 vs sdc
|
|
|
11-21-2014, 08:37 PM
|
#9
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
|
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.
|
11-24-2014, 11:46 AM
|
#10
|
Member
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178
Original Poster
Rep:
|
--> 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
|
|
|
11-24-2014, 05:14 PM
|
#11
|
Member
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178
Original Poster
Rep:
|
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
|
|
|
11-24-2014, 07:16 PM
|
#12
|
Member
Registered: Dec 2012
Posts: 182
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 10:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|