LinuxQuestions.org
Review your favorite Linux distribution.
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 09-06-2012, 08:02 AM   #1
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Rep: Reputation: 0
removing raid 1 rendered server unbootable


Hello
Well i tried removing raid array on our server and baaaam
i did not need the server hard drive to be in raid anymore
it was raid 1 and two hard disk each with three partition
so we had :

md0 swap
md1 /boot
md2 /

i used following method to remove raid
removed /etc/mdadm.conf then
mdadm --zero-superblock /dev/md0
mdadm --zero-superblock /dev/md1
mdadm --zero-superblock /dev/md2

and rebooted an then the disaster
the server is not booting anymore
i have access to rescue system so tried mounting the partition and chrooted
and tried fixing grub via

grub-install /dev/sda

did not work also in my fstab i still have refrence to md`s as partition name
so i tried renaming them to sda[1-3]and nothing

so what else can be done to revive the server ?
i thought mdadm --zero-superblock is safe to use

though now im totally confused on how really raid , partition table and type and namings are in such a configuration
regards
 
Old 09-06-2012, 08:10 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I'd suggest booting from an install cd and going at the files(grub.conf, fstab) from there.
 
Old 09-06-2012, 11:56 AM   #3
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
well still no luck getting server to boot
any other idea or work around ?
 
Old 09-06-2012, 12:04 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Still no luck doesn't tell us much. Have you set up a live cd to boot, and tried to boot from it? If it didn't work, what happened? What does it say?
 
Old 09-06-2012, 01:03 PM   #5
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
sorry
well i do not have visual on server
just i have booted server on data center rescue console and mounted my partitions and chrooted
so in fact i cant see at which stage server hangs
current information

Quote:
proc /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
/dev/sda1 none swap sw 0 0
/dev/sda2 /boot ext3 defaults 0 0
/dev/sda3 / ext3 defaults 0 0

Quote:
Disk /dev/sda: 300.0 GB, 300069052416 bytes
64 heads, 32 sectors/track, 286168 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System
/dev/sda1 2 2048 2096128 fd Linux raid autodetect
/dev/sda2 2049 2304 262144 fd Linux raid autodetect
/dev/sda3 2305 286168 290676736 fd Linux raid autodetect

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
64 heads, 32 sectors/track, 286168 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 286168 293036016 83 Linux

and strange enteries which i think because i installed grub on both hard

Quote:
root@rescue /home # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md2 276G 173G 89G 67% /
none 10M 76K 10M 1% /dev/pts
/dev/sda2 276G 173G 89G 67% /amir
/dev/sda2 276G 173G 89G 67% /boot
/dev/sda2 276G 173G 89G 67% /amir
GRUB
i changed from md2 to sda2
Quote:
# GRUB bootloader configuration file
#

timeout 5
default 0

title CentOS (2.6.18-308.11.1.el5)
root (hd0,1)
kernel /vmlinuz-2.6.18-308.11.1.el5 ro root=/dev/sda2
initrd /initrd-2.6.18-308.11.1.el5.img

title CentOS (2.6.18-274.12.1.el5)
root (hd0,1)
kernel /vmlinuz-2.6.18-274.12.1.el5 ro root=/dev/md2
initrd /initrd-2.6.18-274.12.1.el5.img

title CentOS Linux (2.6.18-274.7.1.el5PAE)
root (hd0,1)
kernel /boot/vmlinuz-2.6.18-274.7.1.el5PAE ro root=/dev/md2
initrd /boot/initrd-2.6.18-274.7.1.el5PAE.img

Last edited by dime111; 09-06-2012 at 01:05 PM.
 
Old 09-06-2012, 07:03 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This is what I would have tried (after doing a backup; use at your own risk; untested)
Code:
# 2 steps to 'remove' 2nd disk
mdadm --fail /dev/md0 /dev/sdb1
mdadm --remove /dev/md0 /dev/sdb1

# Tell it it's no longer a raid
# (you could probably skip this)
mdadm --zero-superblock /dev/md0

# change partitions types from fd=raid to 83=linux, 82 =swap
fdisk /dev/sdb   -  set to what ever

# You'll probably need to switch to a rescue disk at this point,
# as you are fooling with your new system  disk
fdisk /dev/sda   - this is your boot-able system

# test mount each disk + partition to check eg
mount /dev/sda1 /mnt/test
umount /dev/sda1
mount /dev/sdb1 /mnt/test
etc
etc

# backup conf
mv /etc/mdadm.conf{,.old}

# fix up fstab
vim /etc/fstab

# fixup grub.conf
vim boot/grub/grub.conf
 
Old 09-07-2012, 04:39 AM   #7
dime111
LQ Newbie
 
Registered: Jan 2011
Posts: 29

Original Poster
Rep: Reputation: 0
hello
thank you i will tried the steps you mentioned
i created back up and moved to another server so i can totally mess with this server now
just about two last steps

Quote:
# fix up fstab
vim /etc/fstab

# fixup grub.conf
vim boot/grub/grub.conf
can you be more specefic on what the fixes should look like ?
regards
 
Old 09-09-2012, 08:27 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
That's specific to your system, but basically you are replacing your old system/boot disk eg /dev/md0, with the 'new' one eg /dev/sda1.
HTH
 
  


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
upgrade problem - my box rendered unbootable fastestOS Slackware 6 12-17-2008 11:45 AM
Removing HW RAID Question jackpal Linux - Server 3 03-03-2008 12:09 PM
removing software raid configuration sbabcock23 Linux - Software 4 03-07-2007 09:32 AM
will removing a raid disc delete its data? nadroj Linux - Hardware 15 02-15-2006 05:15 AM
Removing Raid 1 krishvij Linux - Newbie 2 03-09-2005 10:23 PM

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

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