Re: LVM partitioning preseed.cfg / kickstart question

2018-03-15 Thread Vincent McIntyre
Below is a known-good partitioning recipe similar to your use case.
It puts all of /, not just /boot, in a real partition.

I think the main difference is the start of the second stanza
614401000   1 lvm
while you have
100 1000 -1 xfs

There may be a bug in handling -1 as the upper limit;
hopefully you will be able to flush it out if so.

To simplify things, I'd stick with d-i alone for the moment
and then introduce kickstart if it is helpful.

Kind regards
Vince

d-i partman-md/device_remove_mdboolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-lvm/device_remove_lvm  boolean true
d-i partman-lvm/confirm_nooverwriteboolean true
d-i partman-lvm/confirmboolean true
d-i partman-lvm/vgdelete_confirm   boolean true
d-i partman-auto-lvm/no_boot   boolean true
d-i partman-auto-lvm/new_vg_name  string linux
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition   select  finish
d-i partman/confirmboolean true
d-i partman-basicfilesystems/no_swap boolean false
d-i partman/mount_style select uuid
d-i partman/confirm_nooverwrite boolean true
d-i partman-auto/method string lvm

d-i partman-auto/expert_recipe  string workstation : \
10245   1024 ext4   \
$primary{ } \
$bootable{ }\
method{ format }\
format{ }   \
use_filesystem{ }   \
filesystem{ ext4 }  \
mountpoint{ / } \
.   \
614401000   1 lvm   \
$defaultignore{ }   \
$primary{ } \
method{ lvm }   \
.   \
2048300%  65536 linux-swap \
$defaultignore{ }   \
$lvmok{ }   \
method{ swap }  \
format{ }   \
.   \
20480   5   20480 ext4  \
$defaultignore{ }   \
$lvmok{ }   \
method{ format }\
format{ }   \
use_filesystem{ }   \
filesystem{ ext4 }  \
mountpoint{ /usr }  \
.   \
40965   4096 ext4   \
$defaultignore{ }   \
$lvmok{ }   \
method{ format }\
format{ }   \
use_filesystem{ }   \
filesystem{ ext4 }  \
mountpoint{ /var }  \
.   \
20485   2048  ext4  \
$defaultignore{ }   \
$lvmok{ }   \
method{ format }\
format{ }   \
use_filesystem{ }   \
filesystem{ ext4 }  \
mountpoint{ /var/log }  \
.   \
204852048 ext4  \
$defaultignore{ }   \
$lvmok{ }   \
method{ format }\
format{ }   \
use_filesystem{ }   \
filesystem{ ext4 }  \
mountpoint{ /tmp }  \
.   \
409654096 ext4  \
$defaultignore{ }   \
$lvmok{ }   \
method{ format }\
format{ }   \
use_filesystem{ }   \
filesystem{ ext4 }  \
   

Re: LVM partitioning preseed.cfg / kickstart question

2018-03-12 Thread Jim Campbell
Gentle bump.  Might someone be able to assist / identify what I'm missing here?

Thanks very much,

Jim

On Tue, Mar 6, 2018, at 1:47 PM, Jim Campbell wrote:
> Hi All,
> 
> I seem to be having trouble with correctly partitioning a hard drive 
> using a PXE boot + preseed file , and am seeking help.
> 
> What works:
> I can use an expert_recipe string as part of a preseed.cfg file 
> contained in a custom ISO (booted via grub-imageboot), and it correctly 
> partitions a drive with LVM.  Additionally, and I can use http-served 
> kickstart file commands like:
> 
> part /boot --fstype ext4 --size 1024 --asprimary
> part pv.01 --size 1 --grow
> volgroup linuxvg pv.01
> logvol swap   --fstype swap --vgname=linuxvg --size=6272   --name=swap
> logvol /  --fstype xfs  --vgname=linuxvg --size=80248  --
> name=root_vol
> logvol /spare --fstype xfs  --vgname=linuxvg --size=61440  --
> name=spare_vol
> logvol /home  --fstype xfs  --vgname=linuxvg --size=76800  --
> name=home_vol --grow
> 
> in an http-served ks=http://path/to/file.ks file, and it will also 
> partition the drive with LVM, but my issue is that the results between 
> the two aren't consistent, and I want to use an expert_recipe string for 
> both.  This is because the expert_recipe string allows for proportional 
> partition sizes based on the overall size of the disk.  (Note: I use the 
> "spare_vol" as a placeholder, and it gets removed in the "post" install 
> section of the installer).
> 
> Where things break down for me:
> For me, any attempt to use a kickstart / kickseed file served via http 
> with an expert_recipe string doesn't give me my desired partitions.
> 
> If I use bare d-i commands for the expert_recipe string in an http-
> served preseed.cfg file, the partitions don't get picked-up at all.
> 
> I tried doing something like (note: this partition layout uses a "spare" 
> partition which gets removed in the "post" installer section):
> 
> echo "d-i partman-auto/expert_recipe string \
>   boot-root :: \
>   1024 1024 1024 ext4 \
>   $primary{ } \
>   $bootable{ }\
>   method{ format }\
>   format{ }   \
>   use_filesystem{ }   \
>   filesystem{ ext4 }  \
>   mountpoint{ /boot } \
>   . \
>   100 1000 -1 xfs \
>   $defaultignore{ }   \
>   $primary{ } \
>   method{ lvm }   \
>   vg_name{ linux }\
>   . \
>   80248 80248 80248 xfs   \
>   $lvmok{ }   \
>   in_vg{ linux }  \
>   lv_name{ root_vol } \
>   method{ format }\
>   format{ }   \
>   use_filesystem{ }   \
>   filesystem{ xfs }   \
>   mountpoint{ / } \
>   . \
>   6272 6272 6272 linux-swap \
>   $lvmok{ }   \
>   in_vg{ linux }  \
>   method{ swap }  \
>   lv_name{ swap_vol } \
>   format{ }   \
>   filesystem{ swap }  \
>   .   \
>   61440 61440 61440 xfs   \
>   $lvmok{ }   \
>   in_vg{ linux }  \
>   lv_name{ spare_vol }\
>   method{ format }\
>   format{ }   \
>   use_filesystem{ }   \
>   filesystem{ xfs }   \
>   mountpoint{ /spare }\
>   . \
>   76800 76800 76800 xfs   \
>   $lvmok{ }   \
>   in_vg{ linux }  \
>   lv_name{ home_vol } \
>   method{ format }\
>   format{ }   \
>   use_filesystem{ }   \
>   filesystem{ xfs }   \
>   mountpoint{ /home } \
> ."  >> /var/spool/kickseed/parse/preseed.cfg
> 
> But I wind up with partitions at /dev/sda1, /dev/sda5 - /sda9 (which I 
> don't want) instead of a primary partitions at /dev/sda1 along with a 
> bunch of /dev/mapper/ . . .  LVM partitions (which I do want). 
> 
> I've also tried including my preseed.cfg in a custom initrd.gz which is 
> out on the server, but to no avail.
> 
> I hope this all makes sense. Let me know if you have any advice or 
> additional questions.
> 
> Kind regards,
> 
> Jim
> 



LVM partitioning preseed.cfg / kickstart question

2018-03-06 Thread Jim Campbell
Hi All,

I seem to be having trouble with correctly partitioning a hard drive using a 
PXE boot + preseed file , and am seeking help.

What works:
I can use an expert_recipe string as part of a preseed.cfg file contained in a 
custom ISO (booted via grub-imageboot), and it correctly partitions a drive 
with LVM.  Additionally, and I can use http-served kickstart file commands like:

part /boot --fstype ext4 --size 1024 --asprimary
part pv.01 --size 1 --grow
volgroup linuxvg pv.01
logvol swap   --fstype swap --vgname=linuxvg --size=6272   --name=swap
logvol /  --fstype xfs  --vgname=linuxvg --size=80248  --name=root_vol
logvol /spare --fstype xfs  --vgname=linuxvg --size=61440  --name=spare_vol
logvol /home  --fstype xfs  --vgname=linuxvg --size=76800  --name=home_vol 
--grow

in an http-served ks=http://path/to/file.ks file, and it will also partition 
the drive with LVM, but my issue is that the results between the two aren't 
consistent, and I want to use an expert_recipe string for both.  This is 
because the expert_recipe string allows for proportional partition sizes based 
on the overall size of the disk.  (Note: I use the "spare_vol" as a 
placeholder, and it gets removed in the "post" install section of the 
installer).

Where things break down for me:
For me, any attempt to use a kickstart / kickseed file served via http with an 
expert_recipe string doesn't give me my desired partitions.

If I use bare d-i commands for the expert_recipe string in an http-served 
preseed.cfg file, the partitions don't get picked-up at all.

I tried doing something like (note: this partition layout uses a "spare" 
partition which gets removed in the "post" installer section):

echo "d-i partman-auto/expert_recipe string \
  boot-root :: \
  1024 1024 1024 ext4 \
  $primary{ } \
  $bootable{ }\
  method{ format }\
  format{ }   \
  use_filesystem{ }   \
  filesystem{ ext4 }  \
  mountpoint{ /boot } \
  . \
  100 1000 -1 xfs \
  $defaultignore{ }   \
  $primary{ } \
  method{ lvm }   \
  vg_name{ linux }\
  . \
  80248 80248 80248 xfs   \
  $lvmok{ }   \
  in_vg{ linux }  \
  lv_name{ root_vol } \
  method{ format }\
  format{ }   \
  use_filesystem{ }   \
  filesystem{ xfs }   \
  mountpoint{ / } \
  . \
  6272 6272 6272 linux-swap \
  $lvmok{ }   \
  in_vg{ linux }  \
  method{ swap }  \
  lv_name{ swap_vol } \
  format{ }   \
  filesystem{ swap }  \
  .   \
  61440 61440 61440 xfs   \
  $lvmok{ }   \
  in_vg{ linux }  \
  lv_name{ spare_vol }\
  method{ format }\
  format{ }   \
  use_filesystem{ }   \
  filesystem{ xfs }   \
  mountpoint{ /spare }\
  . \
  76800 76800 76800 xfs   \
  $lvmok{ }   \
  in_vg{ linux }  \
  lv_name{ home_vol } \
  method{ format }\
  format{ }   \
  use_filesystem{ }   \
  filesystem{ xfs }   \
  mountpoint{ /home } \
."  >> /var/spool/kickseed/parse/preseed.cfg

But I wind up with partitions at /dev/sda1, /dev/sda5 - /sda9 (which I don't 
want) instead of a primary partitions at /dev/sda1 along with a bunch of 
/dev/mapper/ . . .  LVM partitions (which I do want). 

I've also tried including my preseed.cfg in a custom initrd.gz which is out on 
the server, but to no avail.

I hope this all makes sense. Let me know if you have any advice or additional 
questions.

Kind regards,

Jim