Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Preseed] Partman expert recipe Error

206 views
Skip to first unread message

claude juif

unread,
Dec 5, 2014, 9:00:05 AM12/5/14
to
Hi,

I'm stuck with partman expert_recipe for 3 days now and it's driving me crazy.

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 : 


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' } 


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.

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

Regards,
  .

Bob Proulx

unread,
Dec 11, 2014, 7:50:04 PM12/11/14
to
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.

> 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 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 } .

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.

Bob
signature.asc

claude juif

unread,
Dec 11, 2014, 8:40:05 PM12/11/14
to

<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 

Bob Proulx

unread,
Dec 11, 2014, 9:00:04 PM12/11/14
to
claude juif wrote:
> Bob Proulx wrote:
> 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.

Hmm... Sounds good. Thanks for pointing out a reference.

> 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.

One thing I don't like is that the last partition is always as large
as possible. When using lvm I would rather limit the size and keep
the rest in reserve. Using a /dummy placeholder is the only way I
have found to do that so far.

> 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

Without keeping very careful notes in a lab notebook it is easy to
have all of the attempts blur together.

> > 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.

If you have a separate /usr currently everything will still work
fine. But there has been so much <del>flames</del> discussion about
it that I wouldn't recommend setting up new systems that way. I am
not going to write more here about /usr since there is already a huge
amount of discussion available elsewhere.

> 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.

Oh, /var/lib/$FOO. In that case why not make a partition specifically
for /var/lib/mysql or other /var/lib/$FOO things? That is what I do.
I always allocate as specific lv specifically for large disk uses like
mysql or apt-cacher-ng or or kvm whatever.

> > 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.

I understand. Sounds good.

If I had my choice instead of partman I would shell out to an external
script that I would write to handle the partitioning and file system
creation. I keep thinking there must be a way to do that. It would
then make a lot of this much easier. (Easier for me anyway.)

> So i finally ended up with this recipe :

I think you duplicated that paste. But regardless I am happy to read
that you solved your problem. Good deal!

Bob
signature.asc

claude juif

unread,
Dec 12, 2014, 5:40:06 AM12/12/14
to
2014-12-12 2:58 GMT+01:00 Bob Proulx <b...@proulx.com>:
claude juif wrote:
> Bob Proulx wrote:
> 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.

Hmm...  Sounds good.  Thanks for pointing out a reference.

> 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.

One thing I don't like is that the last partition is always as large
as possible.  When using lvm I would rather limit the size and keep
the rest in reserve.  Using a /dummy placeholder is the only way I
have found to do that so far.

I definitly agree with that !
 

> 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

Without keeping very careful notes in a lab notebook it is easy to
have all of the attempts blur together.

> > 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.

If you have a separate /usr currently everything will still work
fine.  But there has been so much <del>flames</del> discussion about
it that I wouldn't recommend setting up new systems that way.  I am
not going to write more here about /usr since there is already a huge
amount of discussion available elsewhere.

> 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.

Oh, /var/lib/$FOO.  In that case why not make a partition specifically
for /var/lib/mysql or other /var/lib/$FOO things?  That is what I do.
I always allocate as specific lv specifically for large disk uses like
mysql or apt-cacher-ng or or kvm whatever.

Wonderful, it's so simple and i've never think of it. Many many thanks for that :D
 

> > 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.

I understand.  Sounds good.

If I had my choice instead of partman I would shell out to an external
script that I would write to handle the partitioning and file system
creation.  I keep thinking there must be a way to do that.  It would
then make a lot of this much easier.  (Easier for me anyway.)

> So i finally ended up with this recipe :

I think you duplicated that paste.  But regardless I am happy to read
that you solved your problem.  Good deal!

I did not duplicate the paste. One part is with lvmignore{ } and the other part is with defaultignore{ } so i can choose with d-i     partman-auto/method (lvm|regular) if i want lvm or not.


Bob

0 new messages