ubuntu und swap size
-
- Beiträge: 27
- Registriert: 23 Nov 2020, 13:30
ubuntu und swap size
ich versuche gerade mit OPSI und dem ubuntu20.04-Paket eine Installation durchzuführen. Doch am Ende ist die Swap-Partition immer 1GB groß und dies ist uns etwas knapp.
Laut Doku sollte die Swap-Partition unter default-Einstellungen so groß sein wie der verfügbare RAM. In unserem Fall 8GB.
Ich habe folgende versucht.
Partion_disk: first
partion_method: lvm
partition_recipe: Atomic
swap_size: <empty>
erwartet: 8GB
vorhanden: 1GB Partition
Partion_disk: first
partion_method: lvm
partition_recipe: Atomic
swap_size: 10GB
erwartet: 10GB
vorhanden: 1GB Partition
Partion_disk: first
partion_method: lvm
partition_recipe: customSwap
swap_size: 10GB
erwartet: 10GB
vorhanden: 2GB FILE
Was mache ich falsch? Wie bekomme ich eine 8GB Swap-Partition erstellt?
Vielen Dank
ror.schach
- SisterOfMercy
- Beiträge: 1556
- Registriert: 22 Jun 2012, 19:18
Re: ubuntu und swap size
Code: Alles auswählen
partition_recipe = productProperties.get('partition_recipe', 'atomic')
if partition_recipe == 'customSwap':
partition_method = 'regular'
swapSizeProp = productProperties.get('swap_size', '')
if swapSizeProp:
removedUnits = removeUnit(swapSizeProp)
swapSize = int(removedUnits)/1048576
logger.notice(u"swap size: %s" % swapSize)
else:
meminfo = open('/proc/meminfo').read()
matched = re.search(r'^MemTotal:\s+(\d+)', meminfo)
if matched:
memory = int(matched.groups()[0])
swapSize = int(memory)/1024
logger.notice(u"memory: %s" % swapSize)
But this does not work the same for UEFI, so are you in UEFI or in legacy mode?
It could also be due to the horrible way you set custom partition sizes in the preseed file. How large is the harddisk that ubuntu is installed on?
-
- Beiträge: 27
- Registriert: 23 Nov 2020, 13:30
Re: ubuntu und swap size
If partition method is automatically set to regluar does this mean I can NOT use crypto? Which would we like to use going forward.
We use UEFI only and we did not touch the preseed file yet.
- SisterOfMercy
- Beiträge: 1556
- Registriert: 22 Jun 2012, 19:18
Re: ubuntu und swap size
Find the line with "d-i partman-auto/expert_recipe string \"
Comment out the customswap thing, and insert your own custom partitioning. Sizes are a bit trial and error.
Example:
Code: Alles auswählen
d-i partman-auto/expert_recipe string \
custom :: \
1130 1130 1130 ext4 \
$primary{ } \
$bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
options/nosuid{ nosuid } \
options/noexec{ noexec } \
options/nodev{ nodev } \
options/noatime{ noatime } \
options/acl{ acl } \
options/user_xattr{ user_xattr } \
mountpoint{ /boot } \
. \
16109 16109 16109 ext4 \
$lvmok{ } \
lv_name{ root } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
options/noatime{ noatime } \
options/acl{ acl } \
options/user_xattr{ user_xattr } \
mountpoint{ / } \
. \
9666 9666 -1 ext4 \
$lvmok{ } \
lv_name{ opt } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
options/nodev{ nodev } \
options/noatime{ noatime } \
options/acl{ acl } \
options/user_xattr{ user_xattr } \
mountpoint{ /opt } \
. \
2150 2150 2150 linux-swap \
method{ swap } \
format{ } \
. \
Then change preseed in configed to the sensible name you gave the file. Set partition_recipe to the name used in the preseed file, in this case custom.
Re: ubuntu und swap size
ich kann das Problem nachstellen und werde schauen wie man das gelöst bekommt.
Grundsätzlich greif das swap_size Property nur wenn das partition_recipe auf customSwap steht.
Das customSwap partition_recipe überschreibt das partition_method auf regular, da es damals so vom Kunden gebraucht wurde, somit wird alles was da drin steht überschrieben.
Verwendet ihr UEFI?
Damals wurde das customSwap vom Kunden nur für BIOS Maschinen gebraucht und das Partitionierungsschema unter UEFI ist da nochmal etwas anders.
Gruß
Mathias
Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.
Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.
uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de
-
- Beiträge: 27
- Registriert: 23 Nov 2020, 13:30
Re: ubuntu und swap size
wir benutzen ausschließlich UEFI.
Gibt es zu dem custom-Preseed-File eine Doku on die ich schaun kann, damit ich nicht blind mit stochern anfange

Danke
ror.schach
- SisterOfMercy
- Beiträge: 1556
- Registriert: 22 Jun 2012, 19:18
Re: ubuntu und swap size
Maybe you have a support contract with uib or with canonical? Otherwise it might be an issue of searching for terms like this: "ubuntu preseed partitioning expert recipe" on your preferred search page.
I think there is also a way of recording your choices during a manual install and using that afterwards, but I have no experience with that at all.
Re: ubuntu und swap size
habe eben eine UEFI VM mit 8GB RAM und 5GB SWAP installiert und wurde korrekt gesetzt.
Gruß
Mathias
Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.
Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.
uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de
-
- Beiträge: 27
- Registriert: 23 Nov 2020, 13:30
Re: ubuntu und swap size
For now we only use the ubuntu20-04 package. Except from product properties we do not change anything. Where do I find the "current preseed file"SisterOfMercy hat geschrieben: ↑26 Jan 2022, 09:00 If you use UEFI only there is another partition recipe that is used. You will have to modify your preseed file. Copy the current preseed file into the custom directory, give it a sensible name.
- SisterOfMercy
- Beiträge: 1556
- Registriert: 22 Jun 2012, 19:18
Re: ubuntu und swap size
/var/lib/opsi/depot/ubuntu20-04/ubuntu20-04.cfgror.schach hat geschrieben: ↑27 Jan 2022, 11:58 For now we only use the ubuntu20-04 package. Except from product properties we do not change anything. Where do I find the "current preseed file"