A typical question asked by many new Linux users. The answer is pretty simple:

Your partitions are not being unmounted properly when you last shutdown the Linux desktop. Linux needs to shutdown properly (I’m sure this applies to Windows and Mac OS too) before powered off. If you skip this step there could be data loss.

If you are using text based session (CLI), type following command as privileged user:
shutdown -h now

If you are using GUI (KDE / Gnome or any other Windows Manager) click on System > Quit button. Look out for shutdown button.

Do not unplug the power supply. Also use UPS (Uninterruptible power supply) to protect data and to avoid other problems. I recommend APC ups for continuous supply of electric power.

Updated for accuracy.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 7 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
7 comments… add one
  • shawn Sep 13, 2007 @ 13:16

    you can also adjust file ext2/ext3 system parameters on partitions via tune2fs.

    if you regularly turn off your pc, and you leave the file system defaults, the drives will fsck on a routine schedule (e.g. every 30 mounts or 120 days…).

    “man tune2fs” to learn more.

  • Jonathan Arnold Sep 13, 2007 @ 14:52

    Not ‘-r’ but rather ‘-h’. -r does a reboot, while -h does a halt, which should power your computer down.

  • Artem Nosulchik Sep 13, 2007 @ 15:03

    Shawn, you’re exactly right. Here is a useful link how to change maximum mounts count value for filesystem: Set up mount count after system will be checked by e2fsck.

  • 🐧 nixCraft Sep 13, 2007 @ 15:52

    Jonathan, thanks for pointing out small issue.

    Shawn, correct, but I don’t think so new user is going to play with that option.

    Artem, thanks for sharing tutorial.

  • speedygeo Sep 14, 2007 @ 2:59

    How can I shutdown properly an external harddrive partition with reiserfs?

  • arunanchal Sep 14, 2007 @ 6:41

    i think the poweroff command work well

  • be4truth Sep 14, 2007 @ 6:59

    In Ubuntu it does routine checks every 30 mounts even if you shut down properly for maintenance.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum