Zum Inhalt

Schlagwort: boot

Windows 10: Creating boot partitions from scratch

First, boot a Windows 10 or Windows Server 2019 rescue CD and enter the command prompt.

Step 1a: If you have the 128MB + 100MB partitions and they are broken for some reason

list disk
select disk
list part
# visually check you are about
# to do the right thing
select part 1
delete part override
select part 2
delete part override

Now continue with step 2.

Step 1b: If you don’t have at least 228MB of unpartitioned space in front of your Windows partition

Boot the gparted Live CD and move your Windows partition to the right, 250MB is usually fine, then continue with step 2.

Step 2: Recreating the UEFI boot partitions and installing the bootloader:

create partition efi size=128
format quick fs=fat32 label="System"
assign letter="k"
create partition msr size=100
exit

bcdboot C:\windows /s k: /f UEFI

Step 3: Profit

That’s all there is to it! Make sure to set your computer to UEFI ONLY, because it’s past 2020.

Leave a Comment

How to hibernate and resume from swap file in Ubuntu 20.04 using full disk encryption

On my laptop, I am running full disk encryption (LUKS with a single encrypted ext4 partition), and a single, large swap file as large as my system RAM (16GB).

Here’s how to make it work:

Make your swapfile have at least the size of your systems RAM:

sudo swapoff /swapfile
sudo dd if=/dev/zero of=/swapfile bs=$(cat /proc/meminfo | grep MemTotal | grep -oh '[0-9]*') count=1024 conv=notrun
sudo mkswap /swapfile
sudo swapon /swapfile

Note the UUID of the partiton containing your swapfile:

$ sudo findmnt -no SOURCE,UUID -T /swapfile
/dev/nvme0n1p5 20562a02-cfa6-42e0-bb9f-5e936ea763d0

Reconfigure the package uswsusp correctly:

sudo apt -y install uswsusp
sudo dpkg-reconfigure -pmedium uswsusp
# Answer "Yes" to continue without swap space
# Select "/dev/disk/by-uuid/20562a02-cfa6-42e0-bb9f-5e936ea763d0" replace the UUID with the result from the previous findmnt command
# Encrypt: "No"

Edit the SystemD hibernate service using sudo systemctl edit systemd-hibernate.service and fill it with the following content:

[Service]
ExecStart=
ExecStartPre=-/bin/run-parts -v -a pre /lib/systemd/system-sleep
ExecStart=/usr/sbin/s2disk
ExecStartPost=-/bin/run-parts -v --reverse -a post /lib/systemd/system-sleep

Note the offset of your swapfile relative to the partition start:

$ sudo swap-offset /swapfile
resume offset = 34818

Tell grub to resume by editiing your etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=20562a02-cfa6-42e0-bb9f-5e936ea763d0 resume_offset=34818 quiet splash"

Update grub:

sudo update-grub

Create /etc/initramfs-tools/conf.d/resume

RESUME=UUID=20562a02-cfa6-42e0-bb9e-5e936ea763d0 resume_offset=34816
# Resume from /swapfile

Update initramfs:

sudo update-initramfs -u -k all

Now you can just hibernate your system with

sudo systemctl hibernate
Leave a Comment

Gentoo GNU/Linux on an SGI Octane

UPDATE: gentoo/octane is released. CLICK HERE!

Finally!

More info will be coming soon. Just come teaser to get you interested 😉

I AM running Linux 4.12 in full 64 bits, gcc 8, a current glibc, and all the modern software. WITH audio. WITH accellerated graphics. And my root volume is on 3x147GB SCSI Software RAID-0 stripeset goodness. And yes, I do have multiple backups. Boom!

rephlex@octane ~ $ uname -a && cat /etc/*release && cat /proc/cpuinfo && df -h && free -m
Linux octane 4.12.0 #2 SMP Fri Dec 14 21:41:04 CET 2018 mips64 R12000 V2.3 FPU V0.0 SGI Octane GNU/Linux
Gentoo Base System release 2.2
NAME=Gentoo
ID=gentoo
PRETTY_NAME=“Gentoo/Linux“
ANSI_COLOR=“1;32″
HOME_URL=“http://www.gentoo.org/“
SUPPORT_URL=“http://www.gentoo.org/main/en/support.xml“
BUG_REPORT_URL=“https://bugs.gentoo.org/“
system type : SGI Octane
machine : Unknown
processor : 0
cpu model : R12000 V2.3 FPU V0.0
BogoMIPS : 449.02
wait instruction : no
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : no
hardware watchpoint : yes, count: 0, address/irw mask: []
isa : mips1 mips2 mips3 mips4
ASEs implemented :
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

processor : 1
cpu model : R12000 V2.3 FPU V0.0
BogoMIPS : 449.02
wait instruction : no
microsecond timers : yes
tlb_entries : 64
extra interrupt vector : no
hardware watchpoint : yes, count: 0, address/irw mask: []
isa : mips1 mips2 mips3 mips4
ASEs implemented :
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 133G 3,1G 123G 3% /
devtmpfs 10M 0 10M 0% /dev
tmpfs 62M 224K 62M 1% /run
shm 310M 0 310M 0% /dev/shm
/dev/md127 269G 7,9G 247G 4% /home
gesamt benutzt frei gemns. Puffer/Cache verfügbar
Speicher: 619 123 63 0 432 471
Swap: 7999 3 7996

1 Comment

Unlock your /home partition and other volumes with cryptsetup on boot (Ubuntu 17.10 / systemd)

With Ubuntu 17.10 using systemd 234-2ubuntu12.1 (as of me writing this) you cannot just do it the obvious way:

This will create lines and/or keyfiles in /etc/crypttab, which systemd happily ignores. At least the unit-files systemd will generate on the fly will fail.

The way to do it, is adding the correct kernel boot parameters luks.uuid= and luks.options= lines to your grub config file.

For Ubuntu, i had to change /etc/default/grub from

GRUB_CMDLINE_LINUX=““

to

GRUB_CMDLINE_LINUX=“luks.uuid=c142f353-fbe8-4965-931e-c9b1e9503fcd luks.uuid=91d55cef-d26c-4e42-8d97-c17a8df79c58 luks.options=timeout=90s“

Fun fact: if you leave out the timeout specification, systemd will simply not ask for the password, stating the timeout expired ^_^

After changing the file, run

sudo update-grub

Leave a Comment