Instalace Debianu a zachování RAIDu

Vojta

Instalace Debianu a zachování RAIDu
« kdy: 15. 02. 2011, 17:39:29 »
Ahoj,

potrebuji preinstalovat debian 5 s mnou zkompilovanym jadrem 2.34 a podporou ext4 na debian 6.0, ktery ext4 podporuje.
duvod: server neni uplne stabilni

system mam nainstalovany na /dev/sda
a raid mam nakonfigurovany pres mdadm na discich /dev/sd[b,c,d,e,f].

Jak to udelat, abych neprisel o data v raid poli. Popr. co mam zkopirovat, abych po naistalovani systemu zase pole rozbehl.

Diky za odpoved.

P.S. v linuxech teprve zacinam
« Poslední změna: 15. 02. 2011, 19:30:47 od Petr Krčmář »


asdfasdf

Re: Preinstalovani debianu se zachovanim dat v raid poli
« Odpověď #1 kdy: 15. 02. 2011, 18:51:45 »
Inštalátor by mal detegovať existujúce pole a v menu, kde sa vyberajú partitions by si mal mať možnosť nainštalovať na existujúcu partition. Pre istotu si presuň dáta z /home. Môžeš to overiť tak, že nabootuješ inštalátor po obrazovku rozdelenia disku a vyskúšaš to spraviť. Na konci je potvrdenie - ak to nepotvrdíš, žiadne zmeny sa nevykonajú.

Osobne by som potom postupoval tak, že by som si všetky dáta presunul do jedného adresára a všetko ostatné zmazal - to môžeš robiť aj v systéme inštalátora, keď sa prepneš na druhú konzolu. Potom by som pokračoval v čistej inštalácii na existujúci disk. Neodporúčam možnosť inštalovať systém na partition, kde už je nejaký systém nainštalovaný.

> duvod: server neni uplne stabilni

Čo presne znamená nestabilný? Väčšinou to nie je dôvod na reinštaláciu, pretože:
* hardvérový problém sa prejaví aj po reinštalácii
* ak si si zmazal nejaký súbor, stačí reinštalovať balík, ktorý ho obsahuje
* ak máš poškodený súborový systém, použi fsck alebo presuň dáta na inú partition a poškodenú partition zruš a znova vytvor

Nespoliehal by som sa na to, že ak nestabilný lenny nahradím squeezeom, magicky bude stabilný. Pokiaľ ide o hardvér, pozri si release notes, či je tam rozdiel v stave podpory.

Vojta

Re: Instalace Debianu a zachování RAIDu
« Odpověď #2 kdy: 16. 02. 2011, 01:37:08 »
Takze Debian jsem nainstaloval. Instalace systemu proběhla bez problému. Nainstaloval mdadm a pole spustil

Kód: [Vybrat]
mdadm --assemble /dev/md0 /dev/sd{b,c,d,e,f}1a zapsal nastaveni do configuracniho souboru.
Kód: [Vybrat]
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
k datum v poli jsem se bez problému dostal, ale po restartování systému, pole bylo zase neaktivní.

Nevite nekdo v cem by mohla byt chyba?

asdfasdf

Re: Instalace Debianu a zachování RAIDu
« Odpověď #3 kdy: 16. 02. 2011, 09:23:05 »
mas v /etc/init.d/ subor lvm2? patri baliku lvm2

co mas v /etc/fstab?

Vojta

Re: Instalace Debianu a zachování RAIDu
« Odpověď #4 kdy: 16. 02. 2011, 10:08:02 »
Dal jsem na vasi radu a nainstaloval jsem balik lvm2, ale stejne to nepomohlo.

fstab:
Kód: [Vybrat]
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda1 during installation
UUID=0eebea8f-395c-4d74-9b22-3d58de778b7a /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=2ff652b6-1c84-4c93-ac07-4f3e0a1dcfb3 none            swap    sw              0       0
/dev/sdg1       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/md0 /media/Uloziste auto defaults 0 0

Ale vsiml jsem si, ze pri bootovani to pise hlasku:

Mounting local filysystems...mount: you must specify the type
failed.


Vojta

Re: Instalace Debianu a zachování RAIDu
« Odpověď #5 kdy: 16. 02. 2011, 10:13:12 »
takze v fstab jsem zmenil
Kód: [Vybrat]
/dev/md0 /media/Uloziste auto defaults 0 0na
Kód: [Vybrat]
/dev/md0 /media/Uloziste ext4 defaults 0 0
a hlaska pri bootvani se zmenila na:

Mounting local filysystems...mount: special device /dev/md0 does not exist
failed.


trubicoid2

Re: Instalace Debianu a zachování RAIDu
« Odpověď #6 kdy: 16. 02. 2011, 10:22:19 »
no a mas ten RAID jako kernel-autodetect?
jestli ne, tak je potreba zajistit pusteni sluzby mdadm, nebo jak se to u debianu jmenuje

co je v /proc/mdstat po nabootovani?

Markoniuss

  • *
  • 19
  • IT Systémový administrátor
    • Zobrazit profil
    • Markoniuss
    • E-mail
Re: Instalace Debianu a zachování RAIDu
« Odpověď #7 kdy: 16. 02. 2011, 10:29:25 »
Několik rad na začátek

  • Server se updatuje pomocí apt-get upgrade, nikoliv reinstalací
  • Než něco uděláš na živém prostředí, testuj si konfiguraci na VMWaru
  • Nesnaž se používat nevyzkoušené věci na živém prostředí, např.: ext4 když prostě officiálně podporováno není

dustin

Re: Instalace Debianu a zachování RAIDu
« Odpověď #8 kdy: 16. 02. 2011, 11:12:39 »
Kód: [Vybrat]
mdadm --assemble /dev/md0 /dev/sd{b,c,d,e,f}1a zapsal nastaveni do configuracniho souboru.
Kód: [Vybrat]
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
k datum v poli jsem se bez problému dostal, ale po restartování systému, pole bylo zase neaktivní.

Nevite nekdo v cem by mohla byt chyba?

V debianu musíš po změně mdadm.conf ještě přegenerovat nové initramfs přes update-initramfs, aby se konfigurák dostal i do úvodního ramdisku. Bez toho se pole automaticky nesestaví, minimálně ne pod tvým požadovaným jménem.

Ještě si zkontroluj mdadm.conf, že je tam definice pole jenom jednou. Často tam již bývají a ten příkaz jenom na konec připojí další konfliktní.

Vojta

Re: Instalace Debianu a zachování RAIDu
« Odpověď #9 kdy: 16. 02. 2011, 11:46:24 »
co je v /proc/mdstat po nabootovani?
po nabootovani:
Kód: [Vybrat]
cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
unused devices: <none>

kdyz zapnu pole manualne:
Kód: [Vybrat]
cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active (auto-read-only) raid5 sdb1[0] sdf1[5] sde1[3] sdd1[2] sdc1[1]
      7814057472 blocks super 1.0 level 5, 64k chunk, algorithm 2 [5/5] [UUUUU]
     
unused devices: <none>

Kód: [Vybrat]
   Device Boot      Start         End      Blocks   Id  System
/dev/sd{b-f}1               1      243202  1953514552   fd  Linux raid autodetect

Tak chyba bude nejspise zde...
Kód: [Vybrat]
Disk /dev/md0: 8001.6 GB, 8001594851328 bytes
2 heads, 4 sectors/track, 1953514368 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 262144 bytes
Disk identifier: 0x00000000

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

To Dustin:
initramfs jsem updatoval a mdadm.conf jsem zkontroloval. Druhy zapis o poli jsem smazal, ale stejne to nepomohlo.

dustin

Re: Instalace Debianu a zachování RAIDu
« Odpověď #10 kdy: 16. 02. 2011, 16:24:44 »
1. Ten příklad s nenalezenou partition tabulkou je jasný, md0 je již partišna, tak na ni nemůžeš pouštět fdisk.

2. Ještě jednou zkontroluj aktuální používaný initramfs. Používáme jenom debian, skoro na všech máme SW raidy a snad vždycky, když s tím byl problém, byly dva důvody:

a) initramfs neobsahoval aktuální mdadm.conf

b) na některém z disků byl nesmazaný superblock raidu (přímo na zařízení, ne na partišně) a automatický sestavovač raidů v jádře celé zařízení použil do degradovaného raidu pod nějakým obskurním jménem (typicky md_0), a pak zahlásil chybu přístupu při sestavování toho správného raidu s partišnami. Dle tvých výpisů toto není tvůj případ.

trubicoid2

Re: Instalace Debianu a zachování RAIDu
« Odpověď #11 kdy: 16. 02. 2011, 17:08:01 »
no jaderna autodetekce nepujde, pac mas super 1.0, a na to je potreba 0.9

a v debianu se dela mdadm v initramfs i kdyz to zarizeni neni / ?

jinak toto jsem delal vcera:

mdadm --assemble /dev/md0 --update=super-minor /dev/....

to se hodi na tu jadernou autodetekci, kdyz pole zapomene, ze ma byt md0

dustin

Re: Instalace Debianu a zachování RAIDu
« Odpověď #12 kdy: 16. 02. 2011, 18:12:12 »
a v debianu se dela mdadm v initramfs i kdyz to zarizeni neni / ?

Tak to pravda nevím, to bych kecal. Je fakt, že ty prooblémy byly vždycky s rootem.

Vojta

Re: Instalace Debianu a zachování RAIDu
« Odpověď #13 kdy: 16. 02. 2011, 19:29:47 »
Tak ja uz fakt nevim co s tim muze byt... raid pole se mi proste nechce pri bootovani samo spustit. Musim to pokazde udelat rucne.

Zkousel jsem dokonce i updatovat grub a toto je vysledek...
Kód: [Vybrat]
# update-grub
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
Generating grub.cfg ...
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
Found background image: /usr/share/images/desktop-base/desktop-grub.png
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
Found linux image: /boot/vmlinuz-2.6.32-5-amd64
Found initrd image: /boot/initrd.img-2.6.32-5-amd64
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: found two disks with the number 0.
error: superfluous RAID member (5 found).
done

trubicoid2

Re: Instalace Debianu a zachování RAIDu
« Odpověď #14 kdy: 17. 02. 2011, 12:10:39 »
tomu grubu nejak nerozumim, zkousel si to rucne jen pres "grub" ?

jeste prej v debianu je nejakej takovejto soubor, ale nevim presne, jak to nastavit, initrdstart asi nepotrebujes a autostart a autocheck jo

cat /etc/default/mdadm

Should have these entries configured in a similar manner as shown:
INITRDSTART='all'
AUTOSTART=true
AUTOCHECK=true
START_DAEMON=true
DAEMON_OPTIONS="--syslog"
VERBOSE=false
USE_DEPRECATED_MDRUN=false