[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Preseed] Partman expert recipe Error





2014-12-12 1:47 GMT+01:00 Bob Proulx <bob@proulx.com>:
claude juif wrote:
> I'm stuck with partman expert_recipe for 3 days now and it's driving me
> crazy.

The partman part of the installer is one of the more obtuse parts.

> I've a 250GB hard drive and i try to use the following partition layout :
>
> primary partition
> 512M /boot
> 4096M swap
>
> LVM
> 10G /usr
> 20G /var
> 10G /
> left free space to /home
>
> so i use this recipe :

I reformatted it to make it easier for me to analyze.

> d-i       partman-auto/expert_recipe string boot-root ::
>   512 513 512 ext3
>   $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ '/boot' } .
>   1024 1025 4096 linux-swap $primary{ } method{ swap } format{ } .
>   1 10 -1 ext3 $primary{ } method{ lvm } vg_name { debian } .
>   10240 10241 10240 ext4 $defaultignore{ } lv_name{ lv_usr } in_vg{ debian } method{ lvm } format{ } $lvmok{ } use_filesystem{ } filesystem{ ext4 } options/noatime{ noatime } mountpoint{ '/usr' } .
>   20480 20481 20480 ext4 $defaultignore{ } lv_name{ lv_var } in_vg{ debian } method{ lvm } format{ } $lvmok{ } use_filesystem{ } filesystem{ ext4 } options/noatime{ noatime } mountpoint{ '/var' } .
>   10240 10241 10240 ext4 $defaultignore{ } lv_name{ lv_root } in_vg{ debian } method{ lvm } format{ } $lvmok{ } use_filesystem{ } filesystem{ ext4 } options/noatime{ noatime } mountpoint{ '/' } .
>   1 10 -1 ext4 $defaultignore{ } lv_name{ lv_home } in_vg{ debian } method{ lvm } format{ } $lvmok{ } use_filesystem{ } filesystem{ ext4 } options/noatime{ noatime } mountpoint{ '/home' }

You have -1 in several entries and I didn't think that was a valid
value there.

I've read this doc http://ftp.dc.volia.com/pub/debian/preseed/partman-auto-recipe.txt where it says : 

<maximal size> is the maximal size for the partition, i.e. a limit
size such that there is no sense to make this partition larger. 
The special value "-1" is used to indicate unlimited partition size. 

So i was thinking this value could work. I've find some example where they you have to put huge value like 10000000 to use all available space left.

I've tried so many things to make it works that i can't really remember why i try to create an extended partition explicitly for lvm

> The only things i get is "Available disk space (250059) is too small for
> expert recipe (15400000000).
>
> This number 15400000000 is so huge. I think about a signed / unsigned error
> in partman. I try to follow the size allocation formula to see if something
> goes wrong but everything looks fine.

I didn't try your recipe but it was missing line continuing
backslashes and the -1 sizes seemed problematic.  Instead here is a
copy of what works for me.

> If someone can give me a hand on this, it would be greatly appreciated.

Try this recipe.

d-i partman-auto/expert_recipe string \
  lvm-multi :: \
    512 512 512 ext2 $primary{ } label{ boot } method{ format } format{ } use_filesystem{ } filesystem{ ext2 } mountpoint{ /boot } . \
    4096 4096 4096 linux-swap $lvmok{ } method{ swap } format{ } . \
    20480 20480 20480 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . \
    20480 20480 20480 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /var } . \
    64 64 64 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /home } .

Since having a separate /usr isn't supported anymore I didn't include
it.  Feel free to modify this to do so however.

I've read many things about /usr not supported anymore, but the debian installer let you choose the multi partioning scheme which use a separate /usr. So i assume it was correct as long as i use an initrd.


I prefer to allocate a fixed size to /home and to keep other space
available in reserve for allocation to other partitions if needed.
With lvm this space may be allocated on the fly.  Here is an example.

d-i partman-auto/expert_recipe string \
  lvm-multi :: \
    512 512 512 ext2 $primary{ } label{ boot } method{ format } format{ } use_filesystem{ } filesystem{ ext2 } mountpoint{ /boot } . \
    4096 4096 4096 linux-swap $lvmok{ } method{ swap } format{ } . \
    20480 20480 20480 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . \
    20480 20480 20480 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /var } . \
    40960 40960 40960 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /home } .
    64 64 64 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /dummy } .


I'm not really comfortable mixing mysql data or others stuff like that (which are in /var/lib/mysql by default and can grow a lot) with my logs files even with logrotate. But it's only my opinion.
 
Then after the creation later I unmount /dummy and lvremove the
partition putting that disk space back into the free list.  That space
would then be available later to increase the size of any partition
you wish.

I want to automate install with foreman, and i really want not to have to do things manually or create special puppet module to override my default scheme. I prefer to set a good scheme at start and stick with it. I can still enlarge lvm volume with other disks later for special need. 

So i finally ended up with this recipe : 

d-i partman-auto/expert_recipe string \
thisDoesNotMatter :: \
256 256 256 ext3 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } options/noauto{ noauto } \
mountpoint{ /boot } \
. \
64 512 4096 linux-swap \
$primary{ } method{ swap } format{ } \
. \
1 600 10000 ext4 \
$lvmok{ } $defaultignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ /usr } \
. \
10000 550 10000 ext4 \
$lvmok{ } $defaultignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ / } \
. \
20000 1 20480 ext4 \
$lvmok{ } $defaultignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ /var } \
. \
2000 1 15000 ext4 \
$lvmok{ } $defaultignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ /home } \
. \
1 600 10000 ext4 \
$lvmignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ /usr } \
. \
10000 550 10000 ext4 \
$lvmignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ / } \
. \
20000 1 20480 ext4 \
$lvmignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ /var } \
. \
2000 1 15000 ext4 \
$lvmignore{ } method{ format } format{ } options/noatime{ noatime } \
use_filesystem{ } $default_filesystem{ } \
mountpoint{ /home } \
.

It works pretty well and handle the case where i want lvm or not, and i can optionnaly choose different filesystem.

I wonder why the partman doc is not clear enough. I still wonder what this "priority" really mean. I've read many things about it, but i'm still confuse.

Many thanks for your explanation.


Bob

Claude 

Reply to: