LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-31-2009, 08:28 AM   #1
gagou7
LQ Newbie
 
Registered: Sep 2009
Distribution: Ubuntu 9.04 / Debian 5.0 / Backtrack 3
Posts: 27

Rep: Reputation: 0
[SOLVED] Plug out a hard disk from a RAID installation


Hi,

I created a RAID 1 system with two hard disk in ext3 with mdadm. If I shutdown my computer and plug out one of them, the system detects the failure but the data are always available, all working fine.

But if I plugged out a hard disk from the RAID system and that I plugged in another computer, the system don't see any data, the hard disk seems to be "Unallocated". Why? The filesystem should be in ext3, then why my other system don't see any data?

Maybe mdadm created partitions type "mdadm" and not ext3? But I'm sure that I formated the two hard disk in ext3 before making the RAID1 system.

Thank's for your help and sorry for my bad english.

Last edited by gagou7; 03-03-2010 at 11:32 AM.
 
Old 10-31-2009, 02:26 PM   #2
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
No problem

First of all, your partition types should be Physical volume for RAID. Second, you should always create your filesystem on the MD device. Third, you probably need to re-add your disk to the raid due to the fact, that it has failed and has been kicked out of the array. The array will start in degraded mode and re-sync the whole drive.
 
Old 10-31-2009, 04:55 PM   #3
gagou7
LQ Newbie
 
Registered: Sep 2009
Distribution: Ubuntu 9.04 / Debian 5.0 / Backtrack 3
Posts: 27

Original Poster
Rep: Reputation: 0
Thank you for your help. In my Debian system I can see the filesystem type of the MD device and it's ext3. And I know I must re-add it to restore the RAID system.

But my question is why if I plugged out a hard disk of my RAID system and then I plugged in another Linux system I can't see the data? Or should I type a command to take out the hard disk from the RAID system BEFORE unplug it?

Thank's for your help.
 
Old 11-01-2009, 03:02 AM   #4
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
Fail, remove

If you want to properly remove a drive from a RAID, you first need to fail, then remove the drive from the RAID. If you then plug in your drive into an other computer, you will most likely have to fsck the disk. However, if you shut down your RAID'ed computer, then mount your driver _READ ONLY_ on the other, everything should be fine. However, you should preferably not boot up the RAID'ed computer in degraded state or you need to do the re-sync, which may take a long time.

In short: you should be able to mount your volumes from the RAID array on an other computer. If nothing works out, try to build a degraded RAID array on the new computer.
 
Old 11-11-2009, 09:42 AM   #5
gagou7
LQ Newbie
 
Registered: Sep 2009
Distribution: Ubuntu 9.04 / Debian 5.0 / Backtrack 3
Posts: 27

Original Poster
Rep: Reputation: 0
Ok, let's go !

To remove a device (here /dev/sdc1) from a raid array, do the following command:

Code:
mdadm --manage /dev/md2 --fail /dev/sdc1 --remove /dev/sdc1
Then, if you want to mount it by this way:

Code:
mount /dev/sdc1 /mnt/sdc1
Mount command return this error:
Code:
mount: unknown filesystem type 'mdraid'
The only way I found, it's to create a degrated array and add the device. If you plug your device in another computer, just do this:

Code:
mdadm --create /dev/md1 --level=1 --raid-disks=2 /dev/sdc1 missing
mkdir /mnt/md1
mount /dev/md1 /mnt/md1
Now you can see all files in "/mnt/md1".

Then if you would like to plug your device in your previous raid array:

Code:
umount /mnt/md1
mdadm /dev/md1 --fail /dev/sdc1 --remove /dev/sdc1
mdadm --stop /dev/md1
mdadm --manage /dev/md0 --re-add /dev/sdc1
And mdadm will start the recovery.

Is there a way to re-add the disk without doing a full resync? Because I have nothing changed on the disk.

[EDIT]

/dev/sdc1 is a part of raid system. If you --fail and --remove it, you can do this to see all files:

Code:
sudo mount /dev/sdc1 /mnt/sdc1
But you got an error like "unknown filesystem type 'mdraid'". If you RAID array have been formated in etx3, the correct command is:

Code:
sudo mount -t ext3 /dev/sdc1 /mnt/sdc1
[/EDIT]

Last edited by gagou7; 02-13-2010 at 04:54 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 partition the RAID hard disk ZAMO Linux - Server 1 03-03-2008 02:13 AM
How could add new Hard Disk in Raid umar79 Linux - General 4 11-06-2007 12:47 AM
Choosing Hard disk for RAID 1 xpucto General 1 12-06-2005 09:00 AM
Reclaim disk partition from hard disk installation EStester Linux - General 1 03-09-2005 11:25 AM
How do I increase my Raid Hard Disk gibs Red Hat 0 09-16-2003 06:15 PM

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

All times are GMT -5. The time now is 08:49 PM.

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