El caso es que en el punto en el que me quedé en el post anterior, sea como sea tengo que currarme el ficherín de configuración de alguna manera, con la información correspondiente a los dispositivos que he ido preparando.Sigo con el ejemplo basado en Redhat, se puede hacer así:
[nouser@nohost etc]# echo DEVICE /dev/sd*[0-9] > /etc/mdadm.conf
[nouser@nohost etc]# mdadm --detail --scan >> /etc/mdadm.conf
Esto me deja el fichero como sigue:
[nouser@nohost init.d]# cat /etc/mdadm.conf
DEVICE /dev/sd*
ARRAY /dev/md3 level=multipath num-devices=2 UUID=587af9fa:97e19b3f:a04eaed1:9bdd3f34
devices=/dev/sdf,/dev/sdb
ARRAY /dev/md2 level=multipath num-devices=2 UUID=710e657f:a654e038:d776a3bc:021562e6
devices=/dev/sdi,/dev/sde
ARRAY /dev/md1 level=multipath num-devices=2 UUID=b0936429:e865370a:d73bd534:1b607145
devices=/dev/sdh,/dev/sdd
ARRAY /dev/md0 level=multipath num-devices=2 UUID=58e3c63b:89d1c2a3:07d02528:f87e5887
devices=/dev/sdg,/dev/sdc
Para parar los arrays que he creado antes...
[nouser@nohost dev]# mdadm --stop /dev/md0
[nouser@nohost dev]# mdadm --stop /dev/md1
[nouser@nohost dev]# mdadm --stop /dev/md2
[nouser@nohost dev]# mdadm --stop /dev/md3
Consulto qué hay en marcha...
[nouser@nohost dev]# mdadm --detail --scan
[nouser@nohost dev]#
... o sea nada. Para arrancarlos de nuevo:
[nouser@nohost dev]# mdadm --assemble --scan
mdadm: /dev/md1 has been started with 2 drives.
mdadm: /dev/md2 has been started with 2 drives.
mdadm: /dev/md3 has been started with 2 drives.
mdadm: /dev/md0 has been started with 2 drives.
Tambien puedo filtrar dmesg:
[nouser@nohost ~]# dmesg | grep md
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
md: md0 stopped.
md: bind
md: bind
md: multipath personality registered as nr 7
multipath: array md0 active with 2 out of 2 IO paths
md: md1 stopped.
md: bind
md: bind
multipath: array md1 active with 2 out of 2 IO paths
md: md2 stopped.
md: bind
md: bind
multipath: array md2 active with 2 out of 2 IO paths
md: md3 stopped.
md: bind
md: bind
multipath: array md3 active with 2 out of 2 IO paths
[nouser@nohost ~]#
Con fdisk asigno LVM a los nuevos devices:
[nouser@nohost /]# fdisk /dev/md0
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 17038912.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/md0: 69.7 GB, 69791383552 bytes
2 heads, 4 sectors/track, 17038912 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-17038912, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-17038912, default 17038912):
Using default value 17038912
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[nouser@nohost /]#
Lo mismo para el resto. Ahora ya puedo trabajar con LVM sobre los nuevos dispositivos, formateo con ext3:
[nouser@nohost dev]# pvcreate /dev/md0
Physical volume "/dev/md0" successfully created
[nouser@nohost dev]# pvcreate /dev/md1
Physical volume "/dev/md1" successfully created
[nouser@nohost dev]# pvcreate /dev/md2
Physical volume "/dev/md2" successfully created
[nouser@nohost dev]# pvcreate /dev/md3
Physical volume "/dev/md3" successfully created
[nouser@nohost dev]# vgcreate vgunic /dev/md0
Volume group "vgunic" successfully created
[nouser@nohost dev]# vgextend vgunic /dev/md1
Volume group "vgunic" successfully extended
[nouser@nohost dev]# vgextend vgunic /dev/md2
Volume group "vgunic" successfully extended
[nouser@nohost dev]# vgextend vgunic /dev/md3
Volume group "vgunic" successfully extended
[nouser@nohost dev]# lvcreate -L 300GB -n lvunic vgunic
Logical volume "lvunic" created
[nouser@nohost dev]# mkfs.ext3 /dev/vgunic/lvunic
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
39321600 inodes, 78643200 blocks
3932160 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
2400 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[nouser@nohost dev]#
Creo un punto de montaje (/mnt/FCDISK) e incorporo la información a /etc/fstab para que lo coja en el siguiente reinicio.
[nouser@nohost /]# cat /etc/fstab
...
/dev/vgunic/lvunic /mnt/FCDISK ext3 defaults 1 1
...
Y de momento aquí me paro.


Inglés a castellano
Anglès a català
Deja tu comentario