Tags:
tag this topic
create new tag
view all tags
---+!! Disk Partitioning On EL7 disk partitioning is done using the [[FstabComponent][fstab component]], this supports adding disks at any time, not just during the install. For Debian/Ubuntu the partition layout can be configured via the fstab component but the actual work is done in the installer using partman, any post-install changes currently have to be done manually. The Debian installer partman configuration comes from =templates/lcfg_disks.seed.tt= and =templates/custom_recipe.tt= in the [[https://svn.lcfg.org/viewvc/source/trunk/lcfg-install/][lcfg-install]] package. %TOC% ---++ LVM On Debian/Ubuntu LVM is enabled by default at install time and, other than =/boot=, the partitions are created as logical volumes. There is currently no support for disabling LVM other than by overriding all the preseed options. <verbatim> d-i partman-auto/method string lvm </verbatim> Note that due to this the partition names for a disk in the fstab resources (e.g. =sda1=, =sda2=) generally have little meaning. The ordering of the tags *is* important though. It is expected that grub/efi and =/boot= partitions come at the start of the list before the partitions which can always be LVM volumes. Any post-install adjustments to the LVM configuration have to be done manually. ---++ GPT On EL7 the disk will configured to use GPT when the =fstab.label_<tag>= (e.g. =fstab.label_sda=) resource is set to =gpt=. On Debian/Ubuntu GPT is enabled by default unless overridden through the preseed resources. <verbatim> # Using GPT, not sure this is all absolutely necessary d-i partman-basicfilesystems/choose_label string gpt d-i partman-basicfilesystems/default_label string gpt d-i partman-partitioning/choose_label string gpt d-i partman-partitioning/default_label string gpt d-i partman/choose_label string gpt d-i partman/default_label string gpt </verbatim> ---++ UEFI / Legacy boot On EL7 the default is legacy boot, UEFI can be enabled by either defining the =USE_UEFI= macro at the top of the LCFG profile or by including the =lcfg/options/boot-uefi.h= header. On Debian/Ubuntu the default is UEFI boot, legacy can be enabled by either defining the =USE_LEGACY_BOOT= macro at the top of the LCFG profile or by including the =lcfg/options/boot-legacy.h= header. As well as controlling the boot mechanism this affects the disk layout. ---+++ EL7 On EL7 with UEFI the partition layout begins like: <verbatim> 1 524kB 83.9GB 83.9GB ext4 sda1 2 83.9GB 84.2GB 287MB fat32 sda2 boot </verbatim> Where the second partition is mounted as =/boot/efi=. With legacy boot the layout begins like: <verbatim> 1 524kB 16.8GB 16.8GB ext4 sda1 2 16.8GB 16.8GB 4719kB sda2 bios_grub </verbatim> In each case the first partition is mounted as =/= (root). ---+++ Debian/Ubuntu On Debian with UEFI the partition layout looks like: <verbatim> </verbatim> With legacy boot the layout looks like this: <verbatim> 1 1049kB 4194kB 3146kB bios_grub 2 4194kB 1029MB 1024MB ext2 3 1029MB 21.5GB 20.4GB lvm </verbatim> Where the second partition is mounted as =/boot=, note that it's not strictly required these days as grub2 can now access LVM volumes. ---++ Disk Encryption The fstab component provides support for configuring dm-crypt via =/etc/crypttab= so that partitions (e.g. =/tmp= and swap) can be encrypted with a random key at boot time. Work on adding support for this in Debian/Ubuntu is ongoing. ---++ Disk Size For EL7 the sizes of partitions can be specified explicitly or set to =free= and for swap there is =redhat-autoswap=. For Debian/Ubuntu partman the disk size is configured via 3 parameters - minimum, maximum and priority. These are used to carve up the disk in the "best" way possible according to some algorithm. The =free= option works in a similar way and will use all remaining disk space after the other partitions have been allocated. The =redhat-autoswap= option gives a minimum of 100% RAM and a maximum of 200% RAM. ---++ Preserving Partitions The LCFG fstab component supports preserving the partition layout and the contents of particular partitions. Although it should be possible we do not yet support this for Debian/Ubuntu installs. In reality given the switch to LVM by default all systems will need to be fully reinstalled so this is not a big issue at this time. ---++ Partition Layout ---+++ Debian/Ubuntu The partman recipe can be selected by setting the =install.disk_layout= resource. The default is =lcfg= which means the layout will be driven by the LCFG fstab component resources. It may otherwise be set to one of =atomic=, =multi= or =home= which will mean the standard Debian/Ubuntu recipe of that name is used. By default the LCFG managed layout is similar to =atomic= but it can be changed to something closer to =multi= by defining the =LCFG_DISK_LAYOUT_MULTI= macro at the start of the LCFG profile. Both support an extra "local part" partition (often =/disk/scratch=) in the usual way. See the [[https://svn.lcfg.org/viewvc/lcfg/core/include/lcfg/options/primary-disk-partitions.h?view=markup][primary-disk-partitions.h]] header for full details. The standard recipes can be found at: * https://salsa.debian.org/installer-team/partman-auto/-/tree/master/recipes * https://salsa.debian.org/installer-team/partman-auto/-/tree/master/recipes-amd64-efi ---++ Useful Links * https://github.com/xobs/debian-installer/blob/master/doc/devel/partman-auto-recipe.txt * https://serverfault.com/questions/953322/preseed-automatic-partitioning * https://cptyesterday.wordpress.com/2012/06/17/notes-on-using-expert_recipe-in-debianubuntu-preseed-files/ -- %USERSIG{squinney - 2020-04-17}%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
M
ore topic actions
Topic revision: r2 - 2020-04-17
-
squinney
Home
Site map
LCFG web
Main web
Sandbox web
TWiki web
LCFG Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
E
dit
A
ttach
Copyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback