LVM on an entire disk

Mathieu Alorent malorent at echo.fr
Fri Oct 30 14:24:14 CET 2009


Le vendredi 30 octobre 2009 à 14:12 +0100, Mathieu Alorent a écrit :
> Le vendredi 30 octobre 2009 à 13:52 +0100, Mathieu Alorent a écrit :
> > Le vendredi 30 octobre 2009 à 12:15 +0100, Mathieu Alorent a écrit :
> > > Le vendredi 30 octobre 2009 à 11:42 +0100, Michael Tautschnig a écrit :
> > > > > Le jeudi 29 octobre 2009 à 16:09 +0100, Michael Tautschnig a écrit :
> > > > > > [...]
> > > > > > 
> > > > > > > 
> > > > > > > I have patched setup-storage to handle LVM on an entire disk like this:
> > > > > > > file: usr/share/fai/setup-storage/Parser.pm near lines 607
> > > > > > > 
> > > > > > >               if ($dev =~ m/^disk(\d+)\.(\d+)/) {
> > > > > > >                 $dev = &FAI::make_device_name("/dev/" . $FAI::disks[ $1
> > > > > > > - 1 ], $2);
> > > > > > > +              } elsif ($dev =~ m/^disk(\d+)/) {
> > > > > > > +               $dev = "/dev/" . $FAI::disks[ $1 - 1 ];
> > > > > > >               } else {
> > > > > > >                 $dev = "/dev/$dev";
> > > > > > >               }
> > > > > > > 
> > > > > > > Hope this will (or has already) be(en) integrated in next release :)
> > > > > > > 
> > > > > > 
> > > > > > Did you actually test/use it like this? If so, I'll get it in in a few moments.
> > > > > > 
> > > > > > Best,
> > > > > > Michael
> > > > > > 
> > > > > 
> > > > > 	
> > > > > However, this need to be fixed...
> > > > > 
> > > > > Executing: udevsettle --timeout=10 && parted -s /dev/sdb set -1 lvm on
> > > > > Command udevsettle --timeout=10 && parted -s /dev/sdb set -1 lvm on had
> > > > > exit code 1
> > > > > 
> > > > 
> > > > Could you try experimental version 3.2.23~beta35+experimental1, which was just
> > > > built? This one includes your proposed patch and a fix for this problem. I
> > > > didn't spot any other things that need to be fixed, but then again I couldn't
> > > > test this release either. Therefore any feedback is appreciated. I don't think
> > > > that patch will be included in the next release of FAI mainline, but any release
> > > > thereafter should include it.
> > > > 
> > > > Best,
> > > > Michael
> > > > 
> > > 
> > > I'll try to test 3.2.23~beta35+experimental1, as soon as possible !
> > > 
> > 
> > Ok, tested, and works as expected... :)
> > thx!!!
> > 
> 
> so sorry, i've tested with the wrong nfsroot !!!
> it's doesn't works...
> 
> here is the results:
> 
> Calling task_install
> Calling task_partition
> Partitioning local harddisks using setup-storage
> Starting setup-storage 1.1.1+exp
> Using config file: /mnt/disk_config/BACKUP
> Executing: parted -s /dev/sda unit TiB print
> Command parted -s /dev/sda unit TiB print had exit code 1
> Executing: parted -s /dev/sda unit B print free
> Command parted -s /dev/sda unit B print free had exit code 1
> Executing: parted -s /dev/sda unit chs print free
> Command parted -s /dev/sda unit chs print free had exit code 1
> Use of uninitialized value in numeric eq (==)
> at /usr/share/fai/setup-storage//Volumes.pm line 282.
> Use of uninitialized value in numeric gt (>)
> at /usr/share/fai/setup-storage//Volumes.pm line 284.
> Invalid end byte
> Error in task partition. Traceback: task_error task_partition task
> task_install task task_action task main
> FATAL ERROR. Installation stopped.
> bash: no job control in this shell
> 
> sorry again...
> 

okay, figure out what was the problem... My partition table was
invalid :/

this maybe be a real problem as the script start by checking the disk
structure.

here are the steps:

Starting setup-storage 1.1.1+exp
Using config file: /mnt/disk_config/BACKUP
Executing: parted -s /dev/sda unit TiB print
Command parted -s /dev/sda unit TiB print had exit code 1
Executing: parted -s /dev/sda unit B print free
Command parted -s /dev/sda unit B print free had exit code 1
Executing: parted -s /dev/sda unit chs print free
Command parted -s /dev/sda unit chs print free had exit code 1
Use of uninitialized value in numeric eq (==)
at /usr/share/fai/setup-storage//Volumes.pm line 282.
Use of uninitialized value in numeric gt (>)
at /usr/share/fai/setup-storage//Volumes.pm line 284.
Invalid end byte
Error in task partition. Traceback: task_error task_partition task
task_install task task_action task main
FATAL ERROR. Installation stopped.


# parted /dev/sda
GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
p                                                                
Error: Invalid partition table on /dev/sda -- wrong signature
0.          
Ignore/Cancel? c  



# parted /dev/sda mklabel msdos
Information: Don't forget to update /etc/fstab, if necessary.          

# parted -s /dev/sda unit B print free

Disk /dev/sda: 64424509439B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End           Size          Type  File system  Flags
        0B     64424509439B  64424509440B        Free Space        

# setup-storage -X
Starting setup-storage 1.1.1+exp
Using config file: /mnt/disk_config/BACKUP
Executing: parted -s /dev/sda unit TiB print
Executing: parted -s /dev/sda unit B print free
Executing: parted -s /dev/sda unit chs print free
Executing: parted -s /dev/sdb unit TiB print
Executing: parted -s /dev/sdb unit B print free
Executing: parted -s /dev/sdb unit chs print free
    Finding all volume groups
  No volume groups found
Executing: mdadm --detail --scan --verbose -c partitions
Executing: parted -s /dev/sdb mklabel msdos
Executing: parted -s /dev/sdb mklabel msdos
Executing: parted -s /dev/sda mklabel msdos
Executing: parted -s /dev/sda mklabel msdos
Executing: parted -s /dev/sda mkpart primary ext3 512B 104858111B
Executing: parted -s /dev/sda mkpart primary linux-swap 104858112B
1178599935B
Executing: parted -s /dev/sda mkpart primary ext3 1178599936B
2252341759B
Executing: parted -s /dev/sda mkpart extended  2252341760B 64424508927B
Executing: parted -s /dev/sda mkpart logical ext3 2252374016B
3825238015B
Executing: parted -s /dev/sda mkpart logical ext3 3825270272B
4899012095B
Executing: parted -s /dev/sda mkpart logical ext3 4899044352B
5435915263B
Executing: parted -s /dev/sda mkpart logical ext3 5435947520B
6509689343B
Executing: parted -s /dev/sda mkpart logical  6509721600B 64424508927B
Executing: parted -s /dev/sda set 1 boot on
Executing: mkfs.ext3  /dev/sda1
Executing: mkswap  /dev/sda2
Executing: mkfs.ext3  /dev/sda3
Executing: mkfs.ext3  /dev/sda5
Executing: mkfs.ext3  /dev/sda6
Executing: mkfs.ext3  /dev/sda7
Executing: mkfs.ext3  /dev/sda8
Executing: pvremove -ff -y /dev/sdb
Executing: pvcreate  /dev/sdb
Executing: vgcreate  BACKUP /dev/sdb
Executing: vgchange -a y BACKUP
Executing: lvcreate  -n BACKUP -L 50 BACKUP
Executing: mkfs.xfs  -f /dev/BACKUP/BACKUP
Executing: lvcreate  -n BACKUP2 -L 50 BACKUP
Executing: mkfs.xfs  -f /dev/BACKUP/BACKUP2
Executing: parted -s /dev/sda set 9 lvm on
Executing: pvremove -ff -y /dev/sda9
Executing: pvcreate  /dev/sda9
Executing: vgcreate  HEBEX /dev/sda9
Executing: vgchange -a y HEBEX
Executing: lvcreate  -n VAR_LOG_AMANDA -L 10240 HEBEX
Executing: mkfs.ext3  /dev/HEBEX/VAR_LOG_AMANDA
Executing: lvcreate  -n VAR_LOG -L 3072 HEBEX
Executing: mkfs.ext3  /dev/HEBEX/VAR_LOG
Executing: readlink -f /dev/BACKUP/BACKUP
Executing: fai-vol_id -u /dev/mapper/BACKUP-BACKUP
Executing: fai-vol_id -l /dev/mapper/BACKUP-BACKUP
/dev/mapper/BACKUP-BACKUP UUID=485f3b66-b2c9-4b3a-a9c3-8a6327f0c2e1
Executing: readlink -f /dev/BACKUP/BACKUP2
Executing: fai-vol_id -u /dev/mapper/BACKUP-BACKUP2
Executing: fai-vol_id -l /dev/mapper/BACKUP-BACKUP2
/dev/mapper/BACKUP-BACKUP2 UUID=14ea2c0d-0637-4ca4-9b2a-81a20baf7ea3
Executing: fai-vol_id -u /dev/sda6
Executing: fai-vol_id -l /dev/sda6
/dev/sda6 UUID=ba1d76be-6349-4ee3-a32e-31f2e3669bab
Executing: fai-vol_id -u /dev/sda3
Executing: fai-vol_id -l /dev/sda3
/dev/sda3 UUID=ffcd5c7b-7421-4460-aa73-3960ddfd6f59
Executing: fai-vol_id -u /dev/sda7
Executing: fai-vol_id -l /dev/sda7
/dev/sda7 UUID=06369d2e-bcd0-40c2-98a9-007efe50934d
Executing: fai-vol_id -u /dev/sda2
Executing: fai-vol_id -l /dev/sda2
/dev/sda2 UUID=2393e61c-31dd-4379-9f91-ec083ab8083b
Executing: fai-vol_id -u /dev/sda8
Executing: fai-vol_id -l /dev/sda8
/dev/sda8 UUID=315def9d-c21f-4572-8b6a-f19eab167e5e
Executing: fai-vol_id -u /dev/sda1
Executing: fai-vol_id -l /dev/sda1
/dev/sda1 UUID=70ef4a3b-b491-4ad0-b80b-2645a6eaeca5
Executing: fai-vol_id -u /dev/sda5
Executing: fai-vol_id -l /dev/sda5
/dev/sda5 UUID=9a9d73f0-7237-4c57-9cad-1ebb4ee0506d
Executing: readlink -f /dev/HEBEX/VAR_LOG_AMANDA
Executing: fai-vol_id -u /dev/mapper/HEBEX-VAR_LOG_AMANDA
Executing: fai-vol_id -l /dev/mapper/HEBEX-VAR_LOG_AMANDA
/dev/mapper/HEBEX-VAR_LOG_AMANDA
UUID=b9e1b38c-190b-4373-981a-cdac039a8b17
Executing: readlink -f /dev/HEBEX/VAR_LOG
Executing: fai-vol_id -u /dev/mapper/HEBEX-VAR_LOG
Executing: fai-vol_id -l /dev/mapper/HEBEX-VAR_LOG
/dev/mapper/HEBEX-VAR_LOG UUID=7541b997-2653-4211-985f-d644bb2e9479

# lvscan 
  ACTIVE            '/dev/BACKUP/BACKUP' [52.00 MB] inherit
  ACTIVE            '/dev/BACKUP/BACKUP2' [52.00 MB] inherit
  ACTIVE            '/dev/HEBEX/VAR_LOG_AMANDA' [10.00 GB] inherit
  ACTIVE            '/dev/HEBEX/VAR_LOG' [3.00 GB] inherit

So it finally works as we want, the error was another problem...

-- 
Mathieu Alorent
Shell&Core Sophia-Antipolis
AUSY
Pour France Telecom – OPF/PORTAILS/DOP/HEBEX/SOPHIA

Tél: 04 97 12 6226

malorent.ext at orange-ftgroup.com

La signature de ce mail peut être vérifiée en installant les autorités de certifications CAcert suivantes :
http://www.cacert.org/certs/root.crt
http://www.cacert.org/certs/class3.crt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4892 bytes
Desc: not available
Url : http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20091030/8617befb/attachment-0001.bin 


More information about the linux-fai mailing list