I basically softlocked my raspberry pi 4 8gb using ubuntu when I attempted to put a shell file on my taskbar. I used nano to put scrot in an .sh file for easy screenshots, and when I tried to put it on my taskbar, my mouse was locked into a drag and drop mode, where no matter the amount of clicks, nothing would happen. No shortcuts from my keyboard work either. Is there something I can do to turn it off without bricking my micro sd card?

EDIT: At the very least I need to unmount my micro sd card so that there is no chance of bricking.

  • @TomasBy >raspberry pi 4 8gb using ubuntu Commented Jan 15, 2021 at 20:53
  • Press [CTRL]+[ALT]+[F2] to get a login prompt.
    – Dougie
    Commented Jan 15, 2021 at 21:01
  • @Dougie nothing happens Commented Jan 15, 2021 at 21:02
  • 1
    Then try [ALT]+[F2]. If that doesn't work, pull the power (doing it once when the system is mostly dormant has a very low risk).
    – Dougie
    Commented Jan 15, 2021 at 21:03
  • I used to pull the power off my pi's all the time and never had an issue Commented Jan 16, 2021 at 0:00

3 Answers 3


If the kernel is still running, you can perform a more gentle reboot by holding Alt+SysRq keys and typing "REISUB". The "S" and "U" parts will attempt to do sync and umount on all filesystems, before "B" (for re-boot) takes place.

If the system won't reboot then, you have to pull the plug. Whatever damage your data might receive is already done at this point. Run fsck on all partitions which were mounted (not just the SD card) to minimize the data loss. On most distributions fsck will run automatically after a crash, at least for partitions from /etc/fstab which were not cleanly unmounted.

I have journaling enabled on my SD card and have never actually lost any data (other than files that were being written at the time of the crash of course).


i pulled the plug and it worked, but my worry derived from the fact that the poweroff process includes unmounting all drives connected, and i had also heard that disconnecting while still mounted may corrupt the entire microsd card preventing further use.

  • 1
    It may but unless the system is very busy I think the consensus around here is that is usually will not. I've been using Pis for 8+ years, dunno how many times I've had to pull a plug, and I can only remember one obvious corruption event from that. So try not to do, but if you need to do it, try and do it when the card isn't being worked heavily (the green ACT led indicates SD card access). The next reboot may take quite a bit longer as the partitions will be scanned if not unmounted properly (and when possible corruption is repaired).
    – goldilocks
    Commented Jan 17, 2021 at 20:17

It is unclear whether your Question is a one-off to recover from a lockup or a general question.

As others have said the risk is low if the Pi is not active, but I choose to be safe.

I include dtoverlay=gpio-shutdown,gpio_pin=21 in config.txt on all my Pi.
This allows me to safely shutdown with a button connected to pins 39,40. Even if I don't use a button you can shutdown with a jumper.

See https://raspberrypi.stackexchange.com/a/117017/8697

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.