# Filesystem Forced fsck all disks.

#### Download Script proxmox\_subscription\_autofix.sh

##### 🚀 One-Line Download &amp; Execute:

```bash
apt update && apt install -y curl && clear && curl -s https://docs.greenhome.stream/attachments/57 | bash
```

**The script** does:

- Detects all `ext4` filesystems (including LVM volumes)
- Forces a **one-time filesystem check** at next boot using `tune2fs -c 1`
- Ensures `/etc/fstab` stays exactly like it was, **without changing anything**
- Reboots the system with `fsck` forced

#### ✅ Final Script — `force_fsck_all.sh`

```bash
#!/bin/bash

echo "🔍 Detecting all ext4 filesystems..."
FILESYSTEMS=$(lsblk -pn -o FSTYPE,NAME | awk '$1 == "ext4" { print $2 }')

echo
echo "🛠️  Forcing fsck on next boot for these filesystems:"
echo "$FILESYSTEMS"
echo

for FS in $FILESYSTEMS; do
    echo "→ Setting fsck trigger for $FS"
    tune2fs -c 1 "$FS"
done

echo
echo "✅ Done. /etc/fstab was not modified."

echo
read -p "⚠️  Reboot now to run fsck on next boot? (y/N): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
    echo "🔁 Rebooting with forced fsck..."
    shutdown -rF now
else
    echo "❌ Reboot skipped. Run 'shutdown -rF now' manually when ready."
fi

```

#### 🚀 How to Use

1. ##### Create the script:

```bash
nano force_fsck_all.sh
```

Paste the script above. Save (`Ctrl+O`, Enter) and exit (`Ctrl+X`).

1. ##### Make it executable:

```bash
chmod +x force_fsck_all.sh
```

1. ##### Run it as root:

```bash
./force_fsck_all.sh
```

#### 🔒 Why `/etc/fstab` is not modified

This version:

- **Does not touch or modify** `<strong>/etc/fstab</strong>` **at all**
- Assumes that your current `/etc/fstab` is correctly set (which it is)

That way, nothing will break, and the root fs stays set to `1`, exactly as Proxmox originally configured it.

<span style="color: rgb(224, 62, 45);">**Ins0mniA**</span>