v0.15.0: Attach existing drive wizard (bind mount, no format)

New Settings wizard to attach drives with existing filesystems without
formatting. Mounts partition at staging path, lets user browse and pick
a subfolder, then bind-mounts it at /mnt/<name> with fstab entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 21:12:02 +01:00
parent e54e097d02
commit 98834dd7e8
8 changed files with 1311 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package storage
// AttachRequest holds parameters for attaching an existing partition
// without formatting — using a bind mount from a subfolder.
type AttachRequest struct {
DevicePath string // "/dev/sdb1" — must have an existing filesystem
MountName string // "hdd_1" → bind-mounts at /mnt/hdd_1
SubPath string // full path on raw mount to bind-mount (e.g., "/mnt/.felhom-raw/hdd_1/felhom_data")
Label string // Display label for the UI
SetDefault bool // Register as default storage path
}
// DirEntry represents a directory entry returned by ListDirectories.
type DirEntry struct {
Name string `json:"name"`
Path string `json:"path"`
HasChildren bool `json:"has_children"`
}
// RawMountBase is the hidden staging directory where partitions are
// temporarily mounted for browsing before the final bind mount.
const RawMountBase = "/mnt/.felhom-raw"