LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-27-2013, 12:06 AM   #1
terry1738
LQ Newbie
 
Registered: Jan 2010
Location: Terrigal Australia
Distribution: Centos Ubuntu
Posts: 3

Rep: Reputation: 0
raid1 remote problem


Good day All.
I have a remote server running raid 1 which I connect to using ssh keys.
I accidently moved the /root/.ssh folder and need to put it back so I can log on again.
The people I rent off provide a rescue shell and I can log on there OK but my knowledge of manipulating raid 1 arrays is almost zero so I read up on it and tried this.
mdadm -A -R /dev/md0 /dev/sdb2
mount /dev/md0 /mnt
which seemed to work OK (I moved the .ssh folder back to root) so I then
umount /mnt
mdadm -S /dev/md0
and rebooted the system which after about 40 minutes came up OK but I still could not log on.
I went in again and the changes I had made were still on the disk (/root/.ssh was were I changed it to) so I made a change to the web directory so I could see if they worked after i rebooted (changed the name of a directory) but when I rebooted the directory still had the old name.
I dont want to try anything else in case I totally destroy the system. I can not see how the disks can be in sync but everything is working fine and I am still locked out.
If someone could enlighten me with the proper way to handle this it would be much appreciated.
 
Old 03-27-2013, 07:56 AM   #2
scinerd
LQ Newbie
 
Registered: Jan 2005
Location: usa
Distribution: Ubuntu, Centos
Posts: 16

Rep: Reputation: 0
Not sure what is happening but I would double check the permissions on your .ssh directory. ssh is very picky about permissions. If you can get to the secure log you can see if this is an issue. I would do a "chmod -R 700 /root/.ssh" and "chown -R root:root /root/.ssh". Also your home directory I think needs to be 750 at most but since you didn't move it that should be ok.

I work with HW raids mostly but I think the problem might be your command "mdadm -A -R /dev/md0 /dev/sdb2" I find the /dev/sdb2 odd. I feel like you might be only mounting half your array. So you make a change on the mirror and it's getting overwritten when you reboot. That would explain the web directory but not why your /root/.ssh worked.
 
Old 03-27-2013, 11:56 AM   #3
terry1738
LQ Newbie
 
Registered: Jan 2010
Location: Terrigal Australia
Distribution: Centos Ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks yes your right and thanks for taking the time to reply I have been at this about 28 hours straight trying to bring myself up to speed with raid and am finally seeing a little daylight that was a pretty awful command and it not only wrote to half the drive it was the wrong raid mdX.
fdisk -l gives

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00035512

Device Boot Start End Blocks Id System
/dev/sda1 * 63 1044224 522081 fd Linux raid autodetect
/dev/sda2 1044225 1951415549 975185662+ fd Linux raid autodetect
/dev/sda3 1951415550 1953520064 1052257+ 82 Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00077abd

Device Boot Start End Blocks Id System
/dev/sdb1 * 63 1044224 522081 fd Linux raid autodetect
/dev/sdb2 1044225 1951415549 975185662+ fd Linux raid autodetect
/dev/sdb3 1951415550 1953520064 1052257+ 82 Linux swap / Solaris

Disk /dev/md1: 998.6 GB, 998589988864 bytes
2 heads, 4 sectors/track, 243796384 cylinders, total 1950371072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md0: 534 MB, 534511616 bytes
2 heads, 4 sectors/track, 130496 cylinders, total 1043968 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

and I cant get the swap partitions to form a raid mdx`

mdadm --assemble --run /dev/md2 /dev/sdb3
mdadm: no recogniseable superblock on /dev/sdb3
mdadm: /dev/sdb3 has no superblock - assembly aborted
Maybe I am using the wrong command

So I think I am knee deep in it and I need to nut my way out of the problem without blowing the data.
So here is my plan
1. I fail all of sda patitions
mdadm --manage /dev/md0 --fail /dev/sda1
mdadm --manage /dev/md1 --fail /dev/sda2

then I restart the drive and see if it boots.
if it does I can add back sdb patitions with
mdadm -a /dev/md0 /dev/sdb1
mdadm -a /dev/md1 /dev/sdb2
If that does not work I can try sda
2 questions is this a reasonable strategy and should I remove the sdb drive before rebooting.
 
Old 03-27-2013, 01:03 PM   #4
terry1738
LQ Newbie
 
Registered: Jan 2010
Location: Terrigal Australia
Distribution: Centos Ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
OK a bit more info I did a mdadm -A scan and it picked up sda2 as failed so I have tried to restart it in that mode but so far no luck however it can take 30 minutes to start so I am still in hope.
I cn mount both disks and the dat seems intact on both disks,
However I cannot make the 2 swap drives into an array
mdadm --assemble --run /dev/md2 /dev/sd[ab]3
mdadm: no recogniseable superblock on /dev/sda3
mdadm: /dev/sda3 has no superblock - assembly aborted

mdadm --assemble --run /dev/md2 /dev/sdb3
mdadm: no recogniseable superblock on /dev/sdb3
mdadm: /dev/sdb3 has no superblock - assembly aborted
Its not going to start so I am going to try sda
 
Old 03-28-2013, 04:24 AM   #5
scinerd
LQ Newbie
 
Registered: Jan 2005
Location: usa
Distribution: Ubuntu, Centos
Posts: 16

Rep: Reputation: 0
Looks like your beyond my knowledge at this point. I wouldn't worry to much about your swap space. You can always wipe it out and recreate it after you get your boot drives in order. If you have enough memory some would argue you don't need swap space at all. If it's taking a long time to start it's my guess it's checking the file system. Good luck sorry I can't help more.
 
  


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
raid1 problem on booting ita Linux - Software 2 08-25-2011 01:44 AM
Have software raid1, but like to change to raid1+0 or 0+1, how? spaceuser Debian 8 03-17-2008 02:07 PM
Degraded raid1 array problem on slack 12.0.0 / mdadm slack-12.0.0 Slackware 5 10-12-2007 06:36 AM
Slack 10.2 RAID1 and quota problem k6_400 Slackware 0 09-23-2006 08:26 AM
RAID1 Problem DrTebi Linux - General 0 11-26-2003 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:49 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