[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RAID1 all bootable



Hi Bob:
Thanks so much for this manual. Unfortunately, I have no more the
initial situation (one HD replaced) because I was hurried by an editor
to provide computational data from my CUDA server. I did not want to
run the server before all my data were backed up. Therefore I did a
fresh amd64 wheezy install on both disks, the old one and the newly
replaced. The installation ended with:

grub-install /dev/sda

update grub

 Now the situation is (and the same on the server, which has only much
larger HDs, and a different balance for opt for the compiled
computational codes, non-deb):

francesco@......:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                938M  170M  720M  20% /
udev                   10M     0   10M   0% /dev
tmpfs                 807M  628K  807M   1% /run
/dev/mapper/vg1-root  938M  170M  720M  20% /
tmpfs                 5.0M     0  5.0M   0% /run/lock
tmpfs                 1.6G  148K  1.6G   1% /run/shm
/dev/md0              176M   19M  148M  11% /boot
/dev/mapper/vg1-home  395G  283G   92G  76% /home
/dev/mapper/vg1-opt   9.2G  1.1G  7.7G  13% /opt
/dev/mapper/vg1-tmp   2.8G   69M  2.6G   3% /tmp
/dev/mapper/vg1-usr    28G  3.3G   23G  13% /usr
/dev/mapper/vg1-var   9.2G  468M  8.3G   6% /var


Nonetheless, I'll try to digest your "manual". At this point, could
you also describe how to safely proceed, on this situation, to have
grub on both disks? It would be useful community wide, to complete the
raid1 installation from the Debian installer. (on the above situation
I commanded "grub-install /dev/sdb", whereby, at next boot, grub was
no more found, and the system entered "grub rescue", from where I
restored the situation of grub on sda only.

Thanks and kind regards
francesco


On Sun, Mar 3, 2013 at 10:26 PM, Bob Proulx <bob@proulx.com> wrote:
> Hi Francesco,
>
> As far as I can determine reading this thread you have had a RAID1
> with two disks sda and sdb.  The disk sda failed.  But grub was only
> installed on the failed sda.  The disk sdb contains a mirror of
> everything but does not boot.
>
> Earlier in the thread Lennart gave an excellent suggestion:
>
> Lennart Sorensen wrote:
>> You can boot the install disk in rescue mode, select the root
>> partition to chroot into, then run grub-install from there.
>>
>> When grub asks where to install, you should configure it for both sda
>> and sdb.  I think 'dpkg-reconfigure grub-pc' is where that is
>> selected.  Might need it to use -plow to asks all levels of questions.
>> Not sure.
>
> +1 for this suggestion.  This is definitely the way to go to fix your
> problem.
>
> Francesco Pietra wrote:
>> In my case, with the sda that contained grub loader replaced by a new
>> disk, the rescue mode  (using the same CD installer for amd64 wheezy)
>> did not find any partition. Inverting the SATA cables, same result.
>
> No partitions at all?  That is scary.  And I find it to be hard to
> believe.  No partitions would mean that the data from your disks were
> zeroed out.  Perhaps you were mistaken?  Please try it again.
>
>> In both cases (I mean position of SATA cables) I went to the shell in
>> the installer environment:
>
> Don't work from the installer environment.  Work from the target
> environment.  That is a critical difference!
>
>> #fisk /dev/sda (or sdb)
>
> "fisk"?  That command does not exist in the installer environment.
> You must have been elsewhere.
>
>>  device contains neither a valid DOS partition table, nor Sun, etc
>> (expected for a raid)
>
> Try 'cat /proc/partitions' for a simple safe read-only start.
>
>> #dmesg |grep -i sd
>>  sda (and sbb): unknown partition table (expected for a raid), however
>> md: raid0
>> md: raid1
>> were identified, along with rai4, 5, 6 etc (unfortunately "| less"
>> does not work to see the whole message).
>>
>> Am I using the Rescue Mode improperly? I was unable to dig into the HD
>> that contains md0 (booth loader, EXT2) and md1 ( LVM partitions home
>> tmp usr opt var swap EXT3)
>
> I believe you are using rescue mode improperly.  I have written about
> how to use rescue mode several times recently.  Here is one posting:
>
>   http://lists.debian.org/debian-user/2013/01/msg00218.html
>
> Here is the official documentation for it:
>
>   http://www.debian.org/releases/stable/i386/ch08s07.html.en
>
> But that is fairly terse.  Let me say that the rescue mode looks just
> like the install mode initially.  It will ask you keyboard and locale
> questions and you might wonder if you are rescuing or installing!  But
> it will have "Rescue" in the upper left corner so that you can tell
> that you are not in install mode and be assured.  Get the tool set up
> with keyboard, locale, timezone, and similar and eventually it will
> give you a menu with a list of actions.  Here is a quick run-through.
>
>   Advanced options...
>   Rescue mode
>   keyboard dialog
>   ...starts networking...
>   hostname dialog
>   domainname dialog
>   ...apt update release files...
>   ...loading additional components, Retrieving udebs...
>   ...detecting disks...
>
> Then eventually it will get to a menu "Enter rescue mode" that will
> ask what device to use as a root file system.  It will list the
> partitions that it has automatically detected.
>
> One of the menu entry items near the bottom will be "Assemble RAID
> array".  That will bring up the next dialog menu asking for partitions
> to assemble.  Select the appropriate for your system.  Then continue.
> Since at this point you have one disk with data and one disk without
> it means you must assemble a degraded array with only one disk.
> Select the disk with your data on it.  Start the array with that one
> disk.
>
> If you used LVM (I always do) then that should produce an additional
> set of listings for the lvm volumes on your system including the root
> logical volume.  Select it.
>
> At that point it presents a menu "Execute a shell in /dev/...".  That
> should get you a shell on your system with the array mounted.  You
> should 'cat /proc/mdstat' and verify that you have a degraded array
> with one disk.
>
> If you replaced sda with a new sda disk then sdb will contain your
> data.  Assuming sdb1 for md0 and sdb5 for md1 would produce the need
> for these commands.  Adjust those partitions as needed to match your
> case.
>
> Examine the arrays.  Assuming md0 is on your sdb1 then:
>
>   mdadm --detail /dev/md0
>
>   mdadm --examine /dev/sdb1
>
> At that point I would do nothing before sync'ing the array to the new
> disk.  If you have multiple arrays then sync each of them.  Adjust
> these partition names as appropriate for your case as determined by
> the above inspection.
>
>   mdadm --manage /dev/md0 --add /dev/sdb1
>   mdadm --manage /dev/md1 --add /dev/sdb5
>   mdadm --manage /dev/md2 ... and so forth
>
> If you have /boot on a separate partition then I would let it finish
> before installing grub.  Or if it is on the main root partition then I
> would let the entire root partition containing /boot finish syncing
> before installing grub.
>
> Install grub to both disks.  You said Wheezy.  The way to install grub
> 2 in wheezy is:
>
>   grub-install /dev/sda
>   grub-install /dev/sdb
>
> That will individually install grub to the MBR of each of the disks.
> Should work.  I test this by booting each disk individually to the
> grub menu screen.  (If you boot past to the kernel on an individual
> disk then it will dirty the array and require a sync again to make the
> mirror clean again.  Booting to the grub menu is usually sufficient to
> test that each disk can individually boot.)
>
> I have done this above technique for real many times and the rescue
> media works very well for it.
>
> Bob


Reply to: