new: nightbase mig
This commit is contained in:
9
2025-11-13-nightbase-migration/0001-temp-backup.sh
Executable file
9
2025-11-13-nightbase-migration/0001-temp-backup.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 실행 안되면 램 64기가도 없는 허-접
|
||||
sudo mount -t tmpfs -o size=64G tmpfs /tmp/night-tmp --mkdir
|
||||
|
||||
SOURCE_PATH=/x/nvme1/NightBase
|
||||
DESTINATION_PATH=/tmp/night-tmp/NightBase
|
||||
|
||||
sudo rsync -a --info=progress2 $SOURCE_PATH/ $DESTINATION_PATH
|
||||
27
2025-11-13-nightbase-migration/0002-partition.sh
Executable file
27
2025-11-13-nightbase-migration/0002-partition.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
DISK_LABEL="ssd1"
|
||||
DEVICE="/dev/nvme1n1"
|
||||
MOUNT_POINT="/x/nvme1"
|
||||
|
||||
sudo gdisk "$DEVICE" <<EOF
|
||||
o
|
||||
y
|
||||
n
|
||||
1
|
||||
|
||||
|
||||
8300
|
||||
w
|
||||
y
|
||||
EOF
|
||||
|
||||
|
||||
PART_DEV="/dev/$(lsblk -ln -o NAME "$DEVICE" | sed -n '2p')"
|
||||
echo "PARTITION: $PART_DEV"
|
||||
|
||||
|
||||
sudo mkfs.btrfs -L "$DISK_LABEL" "$PART_DEV" -f
|
||||
|
||||
sudo mount "$PART_DEV" "$MOUNT_POINT"
|
||||
6
2025-11-13-nightbase-migration/0003-temp-restore.sh
Executable file
6
2025-11-13-nightbase-migration/0003-temp-restore.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SOURCE_PATH=/tmp/night-tmp/NightBase
|
||||
DESTINATION_PATH=/x/nvme1/NightBase
|
||||
|
||||
sudo rsync -a --info=progress2 $SOURCE_PATH/ $DESTINATION_PATH
|
||||
4
2025-11-13-nightbase-migration/README.md
Normal file
4
2025-11-13-nightbase-migration/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# NightBase Migration
|
||||
|
||||
## Goal
|
||||
- Move NightBase quickly to the other folder.
|
||||
16
2025-11-13-nightbase-migration/REVIEW.md
Normal file
16
2025-11-13-nightbase-migration/REVIEW.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Review
|
||||
|
||||
## 0001-temp-backup.sh
|
||||
- **CRITICAL**: No validation that tmpfs mount succeeded before rsync
|
||||
- **CRITICAL**: No check that source path exists
|
||||
- **CRITICAL**: No check for sufficient available RAM (64GB required)
|
||||
|
||||
## 0002-partition.sh
|
||||
- **CRITICAL**: Will destroy all data on `/dev/nvme1n1` without confirmation
|
||||
- **CRITICAL**: Variable `$PART_DEV` may fail if lsblk output format differs; needs `/dev/` prefix for mkfs.btrfs
|
||||
- **WARNING**: No validation that device exists before gdisk
|
||||
|
||||
## 0003-temp-restore.sh
|
||||
- **CRITICAL**: No check that source path exists
|
||||
- **CRITICAL**: No validation that destination is mounted/writable
|
||||
- **WARNING**: Will overwrite existing data at destination without confirmation
|
||||
Reference in New Issue
Block a user