Created
April 7, 2021 22:16
-
-
Save lrvick/31f074b926ee2f84d56c3c050ca006bc to your computer and use it in GitHub Desktop.
Format/partition raw disks without root.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd if=/dev/zero of="disk.raw" bs=512 count=102400 | |
mformat -i disk.raw@@1024K -h 32 -t 32 -n 64 -c 1 | |
mmd -i disk.raw@@1024K ::EFI | |
mmd -i disk.raw@@1024K ::EFI/BOOT | |
mcopy -i disk.raw@@1024K /out/boot.efi ::EFI/BOOT/BOOTX64.EFI | |
dd if=/dev/zero of="root.raw" bs=512 count=307199 | |
mkfs.ext4 -N 0 main.raw | |
cat root.raw >> disk.raw | |
truncate -s "+850M" disk.raw | |
parted disk.raw \ | |
-s \ | |
-a minimal \ | |
mklabel gpt \ | |
mkpart boot FAT16 2048s 102399s \ | |
mkpart root ext4 102400s 409599s \ | |
mkpart home btrfs 409600s 2095102s \ | |
set 1 esp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment