recstrap
Extract the LevitateOS base system to a target directory. Like pacstrap for Arch Linux.
Overview
recstrap extracts the LevitateOS EROFS image from the live ISO to a mounted target directory. This is the equivalent of Arch Linux's pacstrap command.
After running recstrap, you must manually complete the installation: generate /etc/fstab, install a bootloader, set passwords, and configure the system.
Usage
recstrap [OPTIONS] <TARGET>| Argument | Description |
|---|---|
TARGET | Target directory (must be mounted, e.g., /mnt) |
Options
| Option | Description |
|---|---|
--erofs | Custom EROFS image location (auto-detected from live ISO if not specified) |
-f, --force | Allow extraction even if target is not empty or not a mount point |
-q, --quiet | Minimal output for scripting |
-c, --check | Run pre-flight validation only, do not extract |
--version | Show version |
--help | Show help |
Examples
recstrap /mnt recstrap /mnt --erofs /media/usb/filesystem.erofs recstrap /mnt --check recstrap /mnt --force Pre-flight Validation
Before extraction, recstrap validates 14 conditions to catch problems early. Use --check to run only the validation without extracting.
- Running as root
- fsck.erofs is available
- Target directory exists
- Target is a directory (not a file)
- Target is not a protected system path
- Target is writable
- Target is a mount point (skipped with --force)
- Target is empty (skipped with --force; lost+found ignored)
- Sufficient disk space (minimum 2GB)
- EROFS image exists
- EROFS image is a regular file
- EROFS image is readable
- EROFS image is not inside the target directory
- Extraction completes successfully
EROFS Auto-Detection
If --erofs is not specified, recstrap searches these paths in order:
/media/cdrom/live/filesystem.erofs/run/initramfs/live/filesystem.erofs/run/archiso/bootmnt/live/filesystem.erofs/mnt/cdrom/live/filesystem.erofs
Protected Paths
These paths are always blocked as extraction targets, even with --force:
/ /bin /boot /dev /etc /home /lib /lib64 /opt
/proc /root /run /sbin /srv /sys /tmp /usr /var Use a mount point like /mnt instead.
Error Codes
| Code | Exit | Description |
|---|---|---|
| E001 | 1 | Target directory does not exist |
| E002 | 2 | Target is not a directory |
| E003 | 3 | Target directory not writable |
| E004 | 4 | EROFS image not found |
| E005 | 5 | EROFS extraction command failed |
| E006 | 6 | Extracted system verification failed |
| E007 | 7 | EROFS tools not installed |
| E008 | 8 | Must run as root |
| E009 | 9 | Target directory not empty (use --force) |
| E010 | 10 | Target is a protected system path |
| E011 | 11 | Target is not a mount point (use --force) |
| E012 | 12 | Insufficient disk space |
| E013 | 13 | EROFS image is not a regular file |
| E014 | 14 | EROFS image is not readable |
| E015 | 15 | EROFS image is inside target directory |
Post-Extraction
After recstrap completes, continue with the installation:
# Generate fstab
recfstab /mnt >> /mnt/etc/fstab
# Copy pre-built UKI
mkdir -p /mnt/boot/EFI/Linux
cp /media/cdrom/boot/uki/levitateos.efi /mnt/boot/EFI/Linux/
# Enter chroot
recchroot /mnt
# Set root password
passwd
# Install bootloader (auto-discovers UKI)
bootctl install
# Exit and reboot
exit
rebootComparison with pacstrap
| Feature | recstrap | pacstrap |
|---|---|---|
| Source | EROFS image | Package repository |
| Speed | Fast (extract only) | Slower (download + install) |
| Package selection | Full base system | Selectable packages |
| Offline capable | Yes (from live ISO) | No (needs network) |
See Also
- recfstab - Generate fstab entries
- recchroot - Enter chroot environment
- Installation Tools Overview - Workflow overview