You are not logged in.

#1 2024-12-19 08:07:11

wld0102
Member
Registered: 2024-12-19
Posts: 2

(Solved) Need help with an installation script (BTRFS and Swap file)

Using an Arch install script with swapfile and BTRFS subvolumes, which work fine, but Timeshift is unable to create snapshots because [swapfile need to be in its separate volume like '@swap' and not in @](https://github.com/linuxmint/timeshift? … fs-volumes). Those are parts from the script:

    ..
    mount /dev/sda2 /mnt
    btrfs su cr /mnt/@
    btrfs su cr /mnt/@home
    btrfs su cr /mnt/@swap
    umount /mnt
    ..
    mount -o subvol=@ /dev/sda2 /mnt
    mkdir -p /mnt/{boot,home,swap}
    mount -o subvol=@home /dev/sda2 /mnt/home
    mount /dev/sda1 /mnt/boot
    ..
    btrfs fi mkswapfile --size $(free -g | awk 'NR==2{print int($2+1)}')g /swap/swapfile
    echo -e "# Swap\n/swap/swapfile none swap defaults 0 0" >> /etc/fstab
    ..
    cat <<EOF > /boot/loader/entries/$(date +"%y-%m-%d")-archlinux.conf
    title Arch Linux
    linux /vmlinuz-linux
    initrd /intel-ucode.img
    initrd /initramfs-linux.img
    options root=LABEL=Arch rootflags=subvol=@ rw rootfstype=btrfs resume=LABEL=Arch resume_offset=$(btrfs inspect-internal map-swapfile -r /swap/swapfile) quiet
    EOF
    ..

I think the script already do that? Any help if not.

Last edited by wld0102 (2024-12-20 12:12:51)

Offline

#2 2024-12-20 10:09:20

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,694

Re: (Solved) Need help with an installation script (BTRFS and Swap file)

you're not mounting the @swap volume, your swapfile just lands on the root volume.

Last edited by V1del (2024-12-20 15:13:31)

Offline

#3 2024-12-20 12:12:13

wld0102
Member
Registered: 2024-12-19
Posts: 2

Re: (Solved) Need help with an installation script (BTRFS and Swap file)

Oh my bad, thanks @V1del.

Last edited by wld0102 (2024-12-20 12:13:07)

Offline

Board footer

Powered by FluxBB