vytvareni novych RAID mirrorovych disku
David Rohleder
davro na ics.muni.cz
Pondělí Květen 12 20:26:59 CEST 2003
veros-XXXX na tac.cz (Veros Kaplan) writes:
> David Rohleder wrote/napsal:
> :
> : Ahoj,
> :
> : nema nekdo nastroj, kterym se da jednoduse vyrobit novy disk, ktery se
> : da vlozit do RAIDu misto jednoho z havarovanych mirrorovanych disku?
> : Osobne se mi to skoro podarilo castecne automatizovat pomoci parted,
> : ale neni to nic moc dilo. Co jsem zatim zjistil:
> :
> : - parted vyrabi partisny v zavislosti na geometrii, takze kdyz chci
> : vyrobit partisny tesne za sebou, tak se obcas vzteka, ze se
> : prekryvaji a nevyrobi ji.
>
> # sfdisk -d | sed s/hda/hdc/ | sfdisk
>
> Pokud to má různou geometrii, tak jsem si toho ještě nevšiml :-)
To jsem zkousel, ale take se vzteka. Pritom jsou to dva naprosto
totozne disky. Nechapu, proc si vymysli ruznou geometrii:
hda: ST340016A, ATA DISK drive
hdc: ST340016A, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
blk: queue c02a6944, I/O limit 4095Mb (mask 0xffffffff)
hda: 78165360 sectors (40021 MB) w/2048KiB Cache, CHS=4865/255/63, UDMA(100)
blk: queue c02a6ca8, I/O limit 4095Mb (mask 0xffffffff)
hdc: 78165360 sectors (40021 MB) w/2048KiB Cache, CHS=77545/16/63, UDMA(100)
fw:~# sfdisk -d /dev/hda | sed 's/hda/hdc/' | sfdisk /dev/hdc
Checking that no-one is using this disk right now ...
OK
Disk /dev/hdc: 77545 cylinders, 16 heads, 63 sectors/track
Old situation:
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/hdc1 * 0+ 1039 1040- 524128+ fd Linux raid autodetect
/dev/hdc2 1040 2080 1041 524664 82 Linux swap
/dev/hdc3 2081 8321 6241 3145464 fd Linux raid autodetect
/dev/hdc4 8322 39529 31208 15728832 f Win95 Ext'd (LBA)
/dev/hdc5 8322+ 18724 10403- 5243080+ fd Linux raid autodetect
/dev/hdc6 18726+ 39529 20804- 10485121+ fd Linux raid autodetect
New situation:
Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
/dev/hdc1 * 63 1044224 1044162 fd Linux raid autodetect
/dev/hdc2 1044225 2104514 1060290 82 Linux swap
/dev/hdc3 2104515 8385929 6281415 fd Linux raid autodetect
/dev/hdc4 8385930 39841199 31455270 f Win95 Ext'd (LBA)
/dev/hdc5 8385993 18876374 10490382 fd Linux raid autodetect
/dev/hdc6 18876438 39841199 20964762 fd Linux raid autodetect
Warning: partition 1 does not end at a cylinder boundary
sfdisk: I don't like these partitions - nothing changed.
(If you really want this, use the --force option.)
fw:~#
Do stejneho stavu se dostanu, ikdyz mam na zacatku hdc same
nuly. Proste bez force to neudela.
A force mu vnucovat nechci, do takoveho stavu se muzu dostat i s dd.
jeste pro kontrolu:
fw:~# sfdisk -d /dev/hda
# partition table of /dev/hda
unit: sectors
/dev/hda1 : start= 63, size= 1044162, Id=fd, bootable
/dev/hda2 : start= 1044225, size= 1060290, Id=82
/dev/hda3 : start= 2104515, size= 6281415, Id=fd
/dev/hda4 : start= 8385930, size=31455270, Id= f
/dev/hda5 : start= 8385993, size=10490382, Id=fd
/dev/hda6 : start= 18876438, size=20964762, Id=fd
---
-------------------------------------------------------------------------
David Rohleder davro na ics.muni.cz
Institute of Computer Science, Masaryk University
Brno, Czech Republic
-------------------------------------------------------------------------
Další informace o konferenci Linux