linux user group brescia

immagine del castello

Archivio della mailing list

[LugBS] migrazione a raid software su con tabella GPT

Marco Manenti marco.manenti a gmail.com
Mar 13 Maggio 2014 22:32:16 UTC
   -
   -
   -
   -
   -
   -
   - EL MARCONI <http://-/>
   -  23.03.14<http://dominicpratt.de/proxmox-ve-3-0-software-raid/#comment-669>
   -

Combined effort of:
http://dominicpratt.de/proxmox-ve-3-0-software-raid/
http://dominicpratt.de/proxmox-ve-3-0-software-raid/#comment-447

For the latest ProxMox3.2 install on a DL120 G7 with SoftRAID.

Installed first only on /dev/sda. Wanted conversion to RAID1.
No idea what causes the shift in partition numbering, but found out the
hard way that there is one additional /dev/?d?1 of 1024K in front of the
/boot (/dev/sda2) en / (/dev/sda3) partition. Combined this with the sgdisk
instead of the sfdisk and we now have a working system 2 x 1 Tb RAID:

root a proxmox2:~# sgdisk -R=/dev/sdb /dev/sda
The operation has completed successfully.

root a proxmox2:~# sgdisk -G /dev/sdb
The operation has completed successfully.

root a proxmox2:~# sgdisk -t 2:fd00 /dev/sdb
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.

root a proxmox2:~# sgdisk -t 3:fd00 /dev/sdb
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.

root a proxmox2:~# sgdisk -p /dev/sdb
Disk /dev/sdb: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 8E3763E8-A40E-435F-BD72-4D8B11D0ECD8
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 3437 sectors (1.7 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02 primary
2 4096 1048575 510.0 MiB FD00 primary
3 1048576 1953523711 931.0 GiB FD00 primary

root a proxmox2:~# sgdisk -p /dev/sda
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): E93C25C7-BC3F-4B43-A03E-1E16DB180D75
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 3437 sectors (1.7 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02 primary
2 4096 1048575 510.0 MiB EF00 primary
3 1048576 1953523711 931.0 GiB 8E00 primary

root a proxmox2:~# mdadm –create /dev/md0 –level=1 –raid-disks=2 missing
/dev/sdb2
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store ‘/boot’ on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
–metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
root a proxmox2:~# mdadm –create /dev/md1 –level=1 –raid-disks=2 missing
/dev/sdb3
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store ‘/boot’ on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
–metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md1 started.

root a proxmox2:~# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb3[1]
976106304 blocks super 1.2 [2/1] [_U]

md0 : active raid1 sdb2[1]
521920 blocks super 1.2 [2/1] [_U]

unused devices:

root a proxmox2:~# cat /etc/fstab
#
/dev/pve/root / ext3 errors=remount-ro 0 1
/dev/pve/data /var/lib/vz ext3 defaults 0 1
#UUID=044b28d5-190e-4acd-8684-9157b09d2a9e /boot ext3 defaults 0 1
/dev/md0 /boot ext3 defaults 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0

#Rebooted with manual intervention, fsck /dev/mapper/pve-root
#Rebooted with manual intervention, fsck /dev/mapper/pve-data

echo “GRUB_DISABLE_LINUX_UUID=true” >> /etc/default/grub
echo “GRUB_PRELOAD_MODULES=””raid dmraid” >> /etc/default/grub
echo raid1 >> /etc/modules
echo raid1 >> /etc/initramfs-tools/modules
grub-install /dev/sda
grub-install /dev/sdb
# grub-install /dev/md0
update-grub
update-initramfs -u

root a proxmox2:~# sgdisk -t 2:fd00 /dev/sda
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.

root a proxmox2:~# mdadm –add /dev/md0 /dev/sda2
mdadm: added /dev/sda2
root a proxmox2:~# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda2[2] sdb2[1]
521920 blocks super 1.2 [2/1] [_U]
[=============>.......] recovery = 66.8% (349376/521920) finish=0.0min
speed=58229K/sec

md1 : active (auto-read-only) raid1 sdb3[1]
976106304 blocks super 1.2 [2/1] [_U]

unused devices:
root a proxmox2:~# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda2[2] sdb2[1]
521920 blocks super 1.2 [2/2] [UU]

md1 : active (auto-read-only) raid1 sdb3[1]
976106304 blocks super 1.2 [2/1] [_U]

unused devices:

root a proxmox2:~# apt-get install screen
Reading package lists… Done
Building dependency tree
Reading state information… Done
Suggested packages:
iselect screenie byobu
The following NEW packages will be installed:
screen
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 670 kB of archives.
After this operation, 975 kB of additional disk space will be used.
Get:1 http://ftp.nl.debian.org/debian/ wheezy/main screen amd64
4.1.0~20120320gitdb59704-7 [670 kB]
Fetched 670 kB in 1s (613 kB/s)
Selecting previously unselected package screen.
(Reading database … 42449 files and directories currently installed.)
Unpacking screen (from …/screen_4.1.0~20120320gitdb59704-7_amd64.deb) …
Processing triggers for install-info …
Processing triggers for man-db …
Setting up screen (4.1.0~20120320gitdb59704-7) …

pvcreate /dev/md1
vgextend pve /dev/md1
pvmove /dev/sda3 /dev/md1

> /dev/sda3: Moved: 29.3%
> /dev/sda3: Moved: 29.5%
> /dev/sda3: Moved: 29.6%
> /dev/sda3: Moved: 29.8%

> /dev/sda3: Moved: 99.5%
> /dev/sda3: Moved: 99.6%
> /dev/sda3: Moved: 99.7%
> /dev/sda3: Moved: 99.8%
> /dev/sda3: Moved: 99.9%
> /dev/sda3: Moved: 100.0%
> /dev/sda3: Moved: 100.0%

root a proxmox2:~# vgreduce pve /dev/sda3
Removed “/dev/sda3″ from volume group “pve”
root a proxmox2:~# pvremove /dev/sda3
Labels on physical volume “/dev/sda3″ successfully wiped
root a proxmox2:~# sgdisk -t 3:fd00 /dev/sda
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
root a proxmox2:~# mdadm –add /dev/md1 /dev/sda3
mdadm: added /dev/sda3

echo 80000 >/proc/sys/dev/raid/speed_limit_max

root a proxmox2:~# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda2[2] sdb2[1]
521920 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sda3[2] sdb3[1]
976106304 blocks super 1.2 [2/1] [_U]
[>....................] recovery = 0.0% (417408/976106304) finish=233.7min
speed=69568K/sec

unused devices:

Personalities : [raid1]
md0 : active raid1 sda2[2] sdb2[1]
521920 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sda3[2] sdb3[1]
976106304 blocks super 1.2 [2/1] [_U]
[===============>.....] recovery = 79.2% (773717568/976106304)
finish=66.0min speed=51049K/sec

unused devices:

root a proxmox2:~# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sda3[2] sdb3[1]
976106304 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sda2[2] sdb2[1]
521920 blocks super 1.2 [2/2] [UU]

unused devices:
Rating: 0.0/*5* (0 votes cast)
Rating: *0* (from 0 votes)

Antworten<http://dominicpratt.de/proxmox-ve-3-0-software-raid/?replytocom=669#respond>
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lugbs.linux.it/pipermail/lug/attachments/20140514/a86313cb/attachment-0001.html>


Maggiori informazioni sulla lista Lug