You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/faq/usb-sync.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Photobooth offers two ways to get your photos and videos onto a USB stick:
5
5
| Feature | Purpose | Trigger |
6
6
|---------|---------|---------|
7
7
|**USB Sync**| Automatic background sync at a regular interval | Runs continuously while Photobooth is open |
8
-
|**Move2USB**| One-shot copy **or** move of all media | Manual — HTTP endpoint, socket.io command, or hardware button|
8
+
|**Move2USB**| One-shot copy **or** move of all media | Manual — HTTP endpoint or socket.io command |
9
9
10
10
Both features share the same USB device identifier (Adminpanel → **USB Sync → USB device identifier**) and the same Linux mount permissions.
11
11
@@ -26,7 +26,7 @@ The web-server user (`www-data`) needs permission to mount and unmount USB drive
26
26
Photobooth ships two complementary mechanisms that are installed via the **Photobooth Setup Wizard**:
27
27
28
28
1.**Polkit rule** — allows `www-data` to call `udisksctl mount` / `udisksctl unmount` without a password.
29
-
2.**sudoers rule** (`/etc/sudoers.d/021_www-data-usb-sync`) — passwordless `sudo mount`, `sudo umount` and `sudo mkdir -p /media/*` as fallback when udisksctl is unavailable.
29
+
2.**sudoers rule** (`/etc/sudoers.d/021_www-data-usb-sync`) — passwordless `sudo mount /dev/* /media/*`, `sudo umount /dev/*` and `sudo mkdir -p /media/*` as fallback when udisksctl is unavailable. Both `/bin` and `/usr/bin` paths are covered for portability.
30
30
31
31
### Installing via the Setup Wizard
32
32
@@ -45,8 +45,10 @@ The wizard will:
45
45
46
46
- Install the Polkit rule for udisksctl.
47
47
- Install the sudoers rule for mount/umount/mkdir.
48
-
- Try to disable desktop auto-mount (pcmanfm volume handling) to avoid permission conflicts.
49
-
- Remove any legacy `020_www-data-usb` sudoers file.
48
+
- Disable desktop auto-mount (pcmanfm `mount_on_startup`, `mount_removable`, `autorun` in both the system default and user profile config) to avoid permission conflicts.
49
+
- Remove any legacy `020_www-data-usb` sudoers file and `50-photobooth-udisks.rules` polkit file.
50
+
51
+
**Note:** USB mount permissions are also installed automatically when running **2 Fix general permissions** or during a fresh Photobooth install. The dedicated "USB Sync policy" menu entry is only needed to re-apply or remove the rules individually.
50
52
51
53
Run the same menu entry again after OS upgrades to re-apply the rules.
52
54
@@ -115,13 +117,12 @@ Move2USB lets you copy — or move — **all** current photos and videos to the
Move2USB creates a `copy.chk` marker file in the Photobooth data folder before rsync and expects it to appear on the USB stick after sync. If the marker is missing on the USB stick after rsync, the sync is treated as **failed** and no files are deleted (even in `move` mode).
125
+
Move2USB creates a `copy.chk` marker file in the Photobooth data folder before rsync and expects it to appear on the USB stick after sync. If the marker is missing on the USB stick after rsync, the sync is treated as **failed** and no files are deleted (even in `move` mode). After successful verification, both the local and USB-side `copy.chk` files are cleaned up automatically.
125
126
126
127
### What gets deleted in "move" mode
127
128
@@ -140,12 +141,17 @@ Photobooth uses a layered approach to mount USB drives:
140
141
2.**findmnt check** — if udisksctl output was ambiguous, verify via `findmnt`.
141
142
3.**sudo mount** — fallback using the sudoers rule; mounts to `/media/<label>`.
142
143
143
-
For **FAT32** (`vfat`) and **exFAT** volumes the mount options `umask=0000,uid=<www-data>,gid=<www-data>` are set automatically so the web-server process can write to the stick.
144
+
For **FAT32** (`vfat`) and **exFAT** volumes the mount options `umask=0000,uid=<uid>,gid=<gid>` (using the numeric uid/gid of the running process, typically `33` for `www-data`) are set automatically so the web-server process can write to the stick.
144
145
145
146
If a drive is already mounted but **not writable** (e.g. auto-mounted by the desktop with different uid/gid), Photobooth unmounts and re-mounts it with the correct options.
146
147
147
148
Unmounting follows the same order: udisksctl first, `sudo umount` as fallback.
148
149
150
+
**When does each feature unmount?**
151
+
152
+
-**USB Sync** keeps the stick mounted between sync intervals and only unmounts on process termination (SIGTERM/SIGHUP/SIGINT).
153
+
-**Move2USB** unmounts the stick after every sync operation (before deleting local files in `move` mode).
0 commit comments