Fstab Entry Generator
Write /etc/fstab entries for USB drives, SSDs and network shares without guessing at the
six-field format or copying half-broken snippets from a forum post. Pick a starting preset (USB stick,
external SSD, NAS NFS share or Windows backup folder), add one card per mount, and get a live fstab block
you can append straight to your file. The generator pushes you toward the identifiers that survive a
reboot — UUID= instead of /dev/sda1 — writes the options people
forget (nofail on removable drives, _netdev on network shares,
noatime on SSDs), and checks the mistakes that actually break boots: a device path that will
point at a different stick next time you plug one in, a removable drive without nofail that
hangs startup when it’s not connected, or a network mount that systemd tries to bring up before the
network exists. Paste your blkid or lsblk -f output into the lookup panel and
click a row to fill in the right UUID — everything happens in your browser.
blkid/lsblk output it is parsed locally and never sent to a server, so you
can safely look up UUIDs for drives that hold private data.
1 · Starting point
Pick a preset to fill the form with a working baseline. Choosing a preset replaces the current entries — everything can be edited afterwards.
2 · Mounts (one card per fstab line)
Each card becomes one line in /etc/fstab. Click a card to make it the active entry — that’s where the UUID lookup below fills in. Swap and tmpfs lines work here too.
3 · UUID lookup (optional)
Run sudo blkid (or lsblk -f) on the machine and paste the output here — or upload the saved file. Click Use on a row to fill its UUID, filesystem type and label into the active entry. Pasted text is parsed in your browser and never uploaded.
4 · Your fstab entries
Validation
Install on your machine
Copy the entries above into /etc/fstab, then prove they work with mount -a before you reboot — a broken line for a missing device is the classic cause of a system that no longer boots.
# 1. Back up the current table first sudo cp /etc/fstab /etc/fstab.bak # 2. Add the generated lines (paste into your editor of choice) sudo nano /etc/fstab # 3. Verify everything mounts BEFORE rebooting sudo mount -a findmnt -R /mnt/data # check the new mount shows up # 4. If something is wrong, restore and try again sudo cp /etc/fstab.bak /etc/fstab
How an fstab line works
Each line has six whitespace-separated fields. The first names the device, the second where it goes, and the last two are numeric checks that most modern systems ignore — but you still have to write them.
| # | Field | Example | Meaning |
|---|---|---|---|
| 1 | Device | UUID=a1b2… | What to mount. UUID=, PARTLABEL= or a /dev/ path for local disks; server:/export for NFS; //server/share for CIFS; none for tmpfs and swap files. |
| 2 | Mount point | /mnt/data | The directory the filesystem appears under. It must exist — systemd creates it for you at boot on most distros, but sudo mkdir -p /mnt/data first is safer. |
| 3 | Filesystem | ext4 | ext4, xfs, btrfs, vfat, ntfs3, exfat, nfs, cifs, swap, tmpfs… |
| 4 | Options | defaults,noatime,nofail | Comma-separated mount options — see the table below. |
| 5 | dump | 0 | Legacy dump(8) backup flag. Write 0 unless you actually use dump. |
| 6 | pass | 0 | fsck order at boot: 1 for root, 2 for other local filesystems, 0 for everything else (USB sticks, network, swap, tmpfs). |
The options that matter
Most fstab pain comes from getting these wrong. The generator offers them as checkboxes with the reasoning built in — this table is the short version.
| Option | What it does | Use it for |
|---|---|---|
| defaults | rw,suid,dev,exec,auto,nouser,async — the sane baseline. | Everything; start here and override. |
| noatime | Don’t record file access times — fewer writes. | SSDs and SD cards (wear), any read-heavy drive. |
| nofail | If the device is missing at boot, log a warning and continue instead of dropping to emergency mode. | Every removable drive. Without it, a missing USB stick can stop the system from starting. |
| noauto | Don’t mount at boot — only when you run mount /mnt/usb. | USB sticks and SD cards you plug in occasionally. |
| _netdev | Tells systemd this mount needs the network first. | Every NFS and CIFS entry. Without it the mount is attempted before your IP exists and fails (or, worse on older setups, blocks boot). |
| nodev / nosuid / noexec | Ignore device files / setuid bits / executables on the mount. | Data drives and anything you don’t run code from — cheap hardening. |
| uid=1000,gid=1000 | Force ownership to your user (FAT/exfat/NTFS have no real ownership). | USB sticks and SD cards you want to write to as a normal user. |
| x-systemd.device-timeout=10s | How long systemd waits for a slow device before giving up. | USB hubs and enclosures that take a moment to spin up. |
| credentials=/path | Read CIFS username/password from a file instead of the fstab line. | Every CIFS mount — fstab is world-readable, passwords in it are not secret. |
| x-systemd.automount | Mount on first access instead of at boot. | Slow or flaky network shares you don’t need immediately. |
Do it without breaking your boot
- Back up first:
sudo cp /etc/fstab /etc/fstab.bak. One line is all it takes to make a machine unbootable. - Use UUIDs, not device paths.
/dev/sda1is whatever the kernel happened to name the first disk — plug in another stick and your data drive becomessdb1. Runsudo blkidand copy theUUID=value; it follows the filesystem, not the port. - Create the mount point:
sudo mkdir -p /mnt/data && sudo chown $USER /mnt/data. - Add the line and test:
sudo mount -amounts everything in fstab that isn’t mounted yet. If it returns silently, check withfindmnt -R /mnt/data. - Reboot once to be sure. Boot-time mounting is the only thing
mount -acan’t fully prove — especially for network shares andx-systemd.device-timeoutbehaviour. - Unplugged-drive rule: anything removable gets
nofail(and usuallynoauto). That combination means: mount it when it’s there, shrug when it isn’t.
Related tools
Suggested
Luke Keam | techgeek.biz