From 4ade12e45c693a9ce9159188c1245a90614f06fd Mon Sep 17 00:00:00 2001 From: tomit4 Date: Sun, 23 Nov 2025 19:50:33 -0800 Subject: [PATCH] :memo: Made general notes on backing up system --- artix_backup.md | 124 +++++++++++++++++++++++++++++++++ gentoo/gentoo_install_notes.md | 5 +- 2 files changed, 126 insertions(+), 3 deletions(-) create mode 100644 artix_backup.md diff --git a/artix_backup.md b/artix_backup.md new file mode 100644 index 00000000..25ab60f1 --- /dev/null +++ b/artix_backup.md @@ -0,0 +1,124 @@ +# Backing Up On Artix + +## Backing Up: + +Plug in your backup drive: + +```sh +mount /dev/sda1 /mnt/media/usb-drive +``` + +```sh +sudo rsync -aHAXS --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/home/brian/Videos/*","/home/brian/Documents/books/*","/home/brian/Downloads/*","/home/brian/Music/*","/home/brian/Pictures/*"} /* /mnt/media/usb-drive/backup +``` + +## Restoring: + +Plug in the Artix base ISO (runit): + +``` +artixiso login: root +``` + +```sh +fdisk /dev/nvme0n1 +``` + +#### boot + +``` +g (!! removes all disk partitions and creates a new GPT disklabel !!) + +n (new partition) +t (select type of partition) +1 (mark the partition as an EFI system partition) +p (partition number) +Partition number (1 - 128, default 1): 1 +First sector: (leave blank for default) +Last sector: +300M + +n (new partition) +p (partition number) 2 +default +default + +w +``` + +```sh +mkfs.fat -F 32 /dev/nvme0n1p1 +``` + +```sh +mkfs.ext4 /dev/nvme0n1p2 +``` + +Now here is where we deviate from the installation: + +```sh +mount /dev/nvme0n1p2 /mnt +``` + +```sh +mkdir /mnt/boot +``` + +```sh +mount /dev/nvme0n1p1 /mnt/boot +``` + +And run the rsync backup script: + +```sh +rsync -aHAXS --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /mnt/media/usb-drive/backup/* /mnt +``` + +Now, to ensure that GRUB + mkinitcpio work: + +```sh +mount --bind /dev /mnt/dev +mount --bind /proc /mnt/proc +mount --bind /sys /mnt/sys +mount --bind /run /mnt/run +``` + +Now chroot into the restored system: + +```sh +artix-chroot /mnt +``` + +And regenerate grub: + +```sh +grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB +``` + +```sh +grub-mkconfig -o /boot/grub/grub.cfg +``` + +Make sure to regenerate the initramfs (important!): + +```sh +mkinitcpio -P +``` + +And exit and reboot: + +```sh +exit +``` + +```sh +umount -R /mnt +``` + +```sh +reboot +``` + +## If all went well... + +If all went well, you'll boot into a standard arch install, but with no Videos +(too large, pick the ones you want from your backup). diff --git a/gentoo/gentoo_install_notes.md b/gentoo/gentoo_install_notes.md index dc3f2bb0..f90e8ef3 100644 --- a/gentoo/gentoo_install_notes.md +++ b/gentoo/gentoo_install_notes.md @@ -93,9 +93,8 @@ cat /etc/fstab ## General Notes -A general speedrun guide to installing gentoo can be found at: - -https://www.reddit.com/r/Gentoo/comments/td684v/need_help_for_first_time_setting_up_a_virtual/ +Here is a +[general speedrun guide to installing gentoo](https://www.reddit.com/r/Gentoo/comments/td684v/need_help_for_first_time_setting_up_a_virtual/) Install a basic distribution-bin kernel first, then you can: