LinuxForum.Fans
Тема

Создание программного RAID

Автор: Pol 72 сообщений 11050 просмотров
#175292

удалось собрать raid? =)

#175298
i2ks написал:
удалось собрать raid? =)

Дошел до второй страницы до http://www.howtoforge.com/software-raid1-grub-boot-debian-etch-p2

Показать
erver1:~# mount
/dev/sda3 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
/dev/md0 on /mnt/md0 type ext3 (rw)
/dev/md2 on /mnt/md2 type ext3 (rw)

пишет синтаксис не проходит что-скобки в строке лишние а без скобок вообще ерунда получается

#175301
Pol написал:
пишет синтаксис не проходит что-скобки в строке лишние а без скобок вообще ерунда получается

это вы пытаетесь в /etc/fstab что ли прописать?

#175303
i2ks написал:
[quote=Pol]пишет синтаксис не проходит что-скобки в строке лишние а без скобок вообще ерунда получается

это вы пытаетесь в /etc/fstab что ли прописать?[/quote]
Да, перед этим

#175307

и что у вас сейчас в fstab?

#175322
i2ks написал:
и что у вас сейчас в fstab?

То же самое что и было, до всех моих действий :)

#175325

То же что и у английского товарища по несчастию с той страницы

Показать
Did I do something wrong?
Submitted by nochids (not registered) on Mon, 2008-12-01 03:46.

I am relatively new to linux and am completely dependent on these tutorials. I bought a server and installed Suse 10.3. After running Ubuntu on my desktop and laptop, I decided to change the server to run Ubuntu as well (I didn't uninstall Suse - just installed over it??). After installing the server based on "The Perfect Ubuntu Server 8.04" (http://www.howtoforge.com/perfect-server-ubuntu8.04-lts) I installed the ISPConfig as detailed at the end. Then to install RAID, I followed the tutorial perfectly I think, but at the end of step 6 after rebooting, I still show sda1 rather than md0.

root@costarica:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/costarica-root
228G 1.4G 216G 1% /
varrun 502M 108K 502M 1% /var/run
varlock 502M 0 502M 0% /var/lock
udev 502M 76K 502M 1% /dev
devshm 502M 0 502M 0% /dev/shm
/dev/sda1 236M 26M 198M 12% /boot
root@costarica:~#

vi /etc/fstab shows the following:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/mapper/costarica-root
UUID=2e3442d3-c650-480a-a923-4775de238b7f / ext3 relatime,errors=remount-ro,usrquota,grpquota 0 1
# /dev/md0
UUID=251a68c2-1497-433b-b415-d49ca8f2125e /boot ext3 relatime 0 2
# /dev/mapper/costarica-swap_1
UUID=03c6c32e-38bd-4707-9df5-dcdd3049825a none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0



It looks different than the one in the tutorial but I attribute that to being ubuntu rather than debian.



Can anyone shed some light on this for me? Did I miss a step or are there other steps involved because of Ubuntu?



Thanks for any help.



Jason.


reply | view as pdf view as pdf
Fantastic Howto !
Submitted by kaaloo (registered user) on Wed, 2008-07-09 11:33.
Thank you so much for this detailed howto. It saved me a lot of pain and worked perfectly on Ubuntu 8.04.1 LTS.
reply | view as pdf view as pdf
Some corrections and notes after following the howto
Submitted by burke3gd (registered user) on Thu, 2008-02-28 21:41.

Thanks for a great howto! It was a life saver, as I have never set up RAID before, let alone on a running system. The install did not go perfectly however and so I thought I might share my notes and a couple of suggestions. Luckily I did a backup of the entire system before beginning, so I was able to restore the system and begin again after I could not get the system to boot off the RAID array. N.B. I did the install on a Debian testing system (lenny/amd64), but I've checked that everything applies to etch as well.
1. If the disks are not brand new, mdadm will detect the previous filesystem when creating the array and ask if you want to continue. Answer, 'yes'. I also got a segfault error from mdadm and a warning that the disk was 'dirty'. The warning could probably be avoided by zeroing the entire disk with dd. Despite the error and warning everything worked as it should.
2. Instead of: cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf_orig mdadm --examine --scan >> /etc/mdadm/mdadm.conf do: mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf_orig /usr/share/mdadm/mkconf >> /etc/mdadm/mdadm.conf This will create a proper mdadm.conf and remove the control file in /var/lib/mdadm (if arrays are found). If you do not remove the control file, you should get a warning message when updating the initrd images.
3. When editing GRUBS's menu.lst, I followed the advice in the comments and put the stanza for the RAID array, before the '### BEGIN AUTOMAGIC KERNELS LIST' line. If you put your custom stanzas inside the AUTOMAGIC area, they will be overwritten during the next kernel upgrade. Instead of: update-initramfs -u I had to do: dpkg-reconfigure mdadm When asked to specify the arrays needed for the root filesystem, I answered with the appropriate devices (in my case only /dev/md0) instead of selecting the default, 'all'. Otherwise I kept to the default answers. After the initrd images had been created, I updated GRUB: update-grub
4. Instead of using the GRUB shell, I used grub-install to install the boot loader on the hard drives: grub-install /dev/sda grub-install /dev/sdb
5. After having added both disks to the arrays, it was time to update the initrd again. First I executed: dpkg-reconfigure mdadm and was informed that the initrd would not be updated, because it was a custom image. The configure script informed me that I could force the update by running 'update-initramfs' with the '-t' option, so that is what I did: update-initramfs -u -t
6. Every time you update the initrd image, you also have to re-install GRUB in the MBR's: grub-install /dev/sda grub-install /dev/sdb Otherwise the system will not boot and you will be thrown into the GRUB shell. Other notes: It is normal for 'fdisk -l' to report stuff like, 'Disk /dev/md0 doesn't contain a valid partition table'. This is because fdisk cannot read md arrays correctly. If you forget to re-install GRUB in the MBR's, after updating your initrd, and get the GRUB shell on reboot. Do the following: Boot from a Debian Installer CD (full or netinst) of the same architecture as your install (so if you're running amd64, it has to be a amd64 CD). Boot the CD in 'rescue' mode. After networking has been set up and the disks have been detected press CTRL+ALT+F2, followed by Enter, to get a prompt. Execute the following commands (md0=/boot and md2=/): mkdir /mnt/mydisk mount /dev/md2 /mnt/mydisk mount /dev/md0 /mnt/mydisk/boot mount -t proc none /mnt/mydisk/proc mount -o bind /dev /mnt/mydisk/dev chroot /mnt/mydisk grub-install /dev/sda grub-install /dev/sdb exit umount /mnt/mydisk/proc umount /mnt/mydisk/dev umount /mnt/mydisk/boot umount /mnt/mydisk reboot
reply | view as pdf view as pdf

Только только вместо md0 у меня фигурирует sda1

#175327

Pol, не надо посты дублировать :rolleyes:
Так что именно не получается то? smile

#175328

Вот мой fstab

Показать
# /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
/dev/mapper/debian-root / ext3 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=3a90cd65-7cdc-4830-b787-f79ad159225d /boot ext2 defaults 0 2
/dev/mapper/debian-home /home ext3 defaults 0 2
/dev/mapper/debian-swap_1 none swap sw 0 0
# /dev/sdc1 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd0 /media/cdrom1 udf,iso9660 user,noauto 0 0

Не могу сделать

text
 mount /dev/md0 on /mnt/md0 type ext3 (rw)

ругаентся что скобка не проходит

#175342

монтировать так: mount -t ext3 -o rw /dev/md0 /mnt/md0 или как описанов доке mount /dev/md0 /mnt/md0, и не забудьте созлать каталог в /mnt md0, делаем так: mkdir /mnt/mdo

#175346

Хотя df -h показывает следующее

Показать
Файловая система Разм Исп Дост Исп% смонтирована на
/dev/mapper/debian-root
9,2G 4,1G 4,7G 47% /
tmpfs 1,5G 0 1,5G 0% /lib/init/rw
udev 1,5G 224K 1,5G 1% /dev
tmpfs 1,5G 0 1,5G 0% /dev/shm
/dev/sda1 228M 15M 201M 7% /boot
/dev/mapper/debian-home
444G 237M 421G 1% /home
/dev/md0 236M 6,1M 218M 3% /mnt/md0
/dev/sdc1 3,8G 644M 3,2G 17% /media/PENDRIVE
#175352

информация о массивах: cat /proc/mdstat или mdadm -Q --detail /dev/md0

#175374
i2ks написал:
информация о массивах: cat /proc/mdstat или mdadm -Q --detail /dev/md0

смотрите ниже

#175375
text
cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sdb1[1]
      248820 blocks super 1.2 [2/1] [_U]
#175504
Pol написал:
md0 : active raid1 sdb1[1]

что один диск только? oO

#175508
i2ks написал:
[quote=Pol]md0 : active raid1 sdb1[1]

что один диск только? oO[/quote]
получается так а md1 не удавалось по приведенным инструкциям прикрутить

#175509

sdb1 это у вас boot раздел долежн быть, вы все делаете по инструкции или нет?

#175510
i2ks написал:
sdb1 это у вас boot раздел долежн быть, вы все делаете по инструкции или нет?

Всё один в один не пропуская ничего тлько исключение ваш метод по созданию зеркального отображения sda>sdb

#175513

Даже не знаю что и сказать уже. Выводы сюда выкладывайте то что не получается =)

#175514
i2ks написал:
Даже не знаю что и сказать уже. Выводы сюда выкладывайте то что не получается =)

Мне проще выложить что получается smile У меня вопрос. При перезагрузке компьютера можно нажать Ctrl I и подключить RAID Там есть опция Create RAID volume (выбирается тип raid и т.д.) Но после этого пишет сообщение что затрется вся информация. А если создать сначала RAID а потом устанавливать Debian то Debian требует стереть md иначе не устанавливается. Так что замкнутый круг и не знаю как из него выйти

Войдите или зарегистрируйтесь, чтобы ответить.