Compare commits

..

2 Commits

Author SHA1 Message Date
85d896e193 caddy generation 2025-06-27 06:53:40 +02:00
6fc36cf5b1 at last, some backupo information... 2025-06-19 23:30:49 +02:00
3 changed files with 162 additions and 3 deletions

View File

@@ -0,0 +1,123 @@
Step-by-Step Instructions
📀 1. Clone the OS to the New SSD
Well start by cloning your OS from /dev/nvme0 to the new SSD (/dev/nvme1).
a) Partition and Format the New SSD
First, partition the new SSD (/dev/nvme1) and create the root partition:
# Launch fdisk to partition the new SSD
sudo fdisk /dev/nvme1
Type g to create a GPT partition table (if it's not already).
Type n to create a new partition, use the entire disk.
Type w to write the partition table.
Then, format the new partition (/dev/nvme1p1):
sudo mkfs.ext4 /dev/nvme1p1
b) Mount the New SSD
Create a mount point and mount the new SSD:
sudo mkdir /mnt/ssd
sudo mount /dev/nvme1p1 /mnt/ssd
c) Clone the OS from /dev/nvme0 to /dev/nvme1
Now, well copy the entire root filesystem, excluding /home, to the new SSD:
sudo rsync -aAXv / --exclude=/home --exclude=/proc --exclude=/sys \
--exclude=/dev --exclude=/run --exclude=/mnt --exclude=/tmp \
/mnt/ssd/
###################################################################################################
This command copies the entire OS and system data but excludes /home, as well sync that separately later.
🧩 2. Prepare the New SSD to Boot
a) Mount Necessary Filesystems and Chroot
To make the new installation bootable, we need to bind mount critical filesystems and chroot into the new root.
for dir in dev proc sys; do
sudo mount --bind /$dir /mnt/ssd/$dir
done
If you are using UEFI, you might also need to mount the EFI partition:
sudo mount /dev/nvme0p1 /mnt/ssd/boot/efi # Adjust if needed
Now, enter the chroot environment:
sudo chroot /mnt/ssd
b) Update /etc/fstab
Make sure /etc/fstab points to the correct root filesystem and removes any /home partition references.
blkid # Get the UUID of /dev/nvme1p1
nano /etc/fstab
Ensure the / entry is updated to use the new SSD, for example:
UUID=<new-uuid> / ext4 defaults 0 1
And remove or comment out any /home partition entry.
c) Install GRUB on the New SSD
Now install GRUB to make the system bootable from /dev/nvme1.
grub-install /dev/nvme1
update-grub
exit
🔄 3. Reboot from the New SSD
Reboot the system.
Go into BIOS/UEFI and set /dev/nvme1 as the primary boot drive.
Boot into the new SSD.
📁 4. Sync /home from /dev/sda (Old Home Drive)
Now, well sync the /home data from the old drive (/dev/sda) onto the new root partition.
a) Mount the Old /home Drive
First, mount /dev/sda (the old /home drive):
sudo mount /dev/sda1 /mnt/oldhome
b) Sync /home to the New SSD
Now, copy the /home data:
sudo rsync -aAXv /mnt/oldhome/ /home/
Make sure /home is mounted correctly on /dev/nvme1p1 (the new SSD) by checking with df -h or lsblk.
🧹 5. Cleanup (Optional)
Once you verify everything works as expected:
Remove /home entry from /etc/fstab if it exists.
You can either repurpose or wipe the old drives (/dev/nvme0 and /dev/sda).
Confirm everything is working fine and youre now booting from /dev/nvme1.
✅ Final Checks
Check disk usage:
df -h
Verify partitioning:
lsblk
Verify boot order in BIOS/UEFI to make sure you're booting from /dev/nvme1.
This approach ensures you move everything safely, with minimal risk of data loss.
Let me know if you encounter any issues or need further clarification!

View File

@@ -1,9 +1,11 @@
(cd "/home/soenke/docker/" && echo "" > newCaddyfile)
(cd "/home/soenke/docker/" && echo "" > ./caddy/newCaddyfile)
for dir in *; do
if [ -d "$dir" ]; then
( cd "$dir" && cat Caddyfilepart >> ../newCaddyfile)
( cd "$dir" && cat Caddyfilepart >> ../caddy/newCaddyfile)
fi
done
( cd "/home/soenke/docker/caddy" )
( mv Caddyfile Caddyfile.bak)
( mv newCaddyfile Caddyfile)
( cd "/home/soenke/docker/caddy" && docker compose down && docker compose pull && docker compose up -d)

34
scratch_4.md Normal file
View File

@@ -0,0 +1,34 @@
sudo mount /dev/nvme0p1 /mnt/newssd/boot/efi
sudo chroot /mnt/newssd
/dev/nvme1n1p1: UUID="ad271484-f3d7-4065-b1b7-224cdd4cd1ca" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3c04012f-35d1-a64d-bc80-04382a24d521"
soenke@heimdall:/var/cache$ sudo blkid
/dev/nvme0n1p3: UUID="4476761c-6ba1-4ef7-bb5f-81f38f96ff44" TYPE="swap" PARTUUID="f60a9a77-2842-40ab-9315-e92e35f42ca6"
/dev/nvme0n1p1: UUID="1504-1CE6" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="c4c73403-14cd-4a99-842c-a02c5c772214"
/dev/nvme0n1p2: UUID="f6b9a157-815a-4f61-a463-0caf165a92b4" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="260bc56c-585a-446f-b2c2-ba7e1057289d"
/dev/sda1: UUID="c810ee0e-35ab-4f2a-a273-0a94ea401731" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="721505ac-9419-4475-9843-e5058fb41550"
vi /etc/fstab
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=ad271484-f3d7-4065-b1b7-224cdd4cd1ca / ext4 errors=remount-ro 0 1 ### change this line to uuid of nvme1(or 1)n1p2 (ext4 one...) -> f6b9a157-815a-4f61-a463-0caf165a92b4
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=1504-1CE6 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sda1 during installation
# UUID=c810ee0e-35ab-4f2a-a273-0a94ea401731 /home ext4 defaults 0 2 ####Re-Add this one?
# swap was on /dev/nvme0n1p3 during installation
UUID=4476761c-6ba1-4ef7-bb5f-81f38f96ff44 none swap sw 0 0