-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux sync Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to sync on Linux, covering Arch Linux, CachyOS, and other distributions including flushing buffers, data synchronization, and safe shutdown preparation.
sync flushes file system buffers.
Uses:
- Flush buffers: Write cached data to disk
- Data safety: Ensure data is written
- Shutdown preparation: Prepare for shutdown
- Data integrity: Maintain data integrity
Why it matters:
- Data safety: Ensures data is saved
- System stability: Prevents data loss
- Shutdown safety: Safe system shutdown
Basic usage:
# Flush all buffers
sync
# Writes all cached data to diskSafe flush:
# Multiple sync calls
sync; sync; sync
# Ensures all data is writtenForce write:
# Force write cached data
sync
# Writes all buffered data to diskFilesystem sync:
# Sync specific filesystem
sync /dev/sda1
# Syncs specific devicePrepare shutdown:
# Before shutdown
sync
# Then shutdown
sudo shutdown -h nowBefore unmounting:
# Before unmount
sync
sudo umount /mnt
# Ensures data is writtenCheck installation:
# sync is part of coreutils
# Usually pre-installed
# Check sync
which syncThis guide covered sync usage, buffer flushing, and data synchronization for Arch Linux, CachyOS, and other distributions.
- umount Guide - Unmounting filesystems
- Filesystem Management - Filesystem operations
- Backup and Restore - Data backup
-
sync Documentation:
man sync
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.