Accidently ran sudo rm -rf /*

@soundofthunder

1 Like

Tip:

Disable Fast Startup in Windows (elevated privileges required.):

powercfg /h off

and, uncomment this line in /etc/default/grub[*]:

#GRUB_DISABLE_OS_PROBER=false

This allows Windows (or another OS) to be detected by Grub during boot.

Note[*]: This assumes the os-prober package is installed.

Yup, I used testdisk after Vista messed up - it recovered a huge number of files, many were partially corrupted and I spent a good month working through them to recover photos/video which was okay.

It’s great for an instant recovery, but the system will mess up your disk if you don’t halt and recover very quickly.

I was working on a 1.5TB HDD some years ago, and that was a good 18 hours - that’s the last time I ran a system without some kind of rsync snapshot or (as now) instant snapshots on root and rsync backups to a /mnt/HDD backup folder.

I’ve reinstalled. BTRFS, separate home partition, and UEFI. (and encryption)

For those who tumble upon the same issue, here’s my advice, in retrospect:

First, run testdisk, see if you can get anything back.

If testdisk doesn’t return the files to make a bootable system, looks like your in for a reinstall. If so, use this:

  1. Use BTRFS. Chance is, if you end up in this situation, as @Ben said,
  1. Separate home partition. As @dmt put it,
  1. Watch yo commands, homie! Y’all bet you don’t want to end up like this guy, @Warp. Looking like the biggest *nix newb to ever roam this Earth, running that command.

  2. Make backups, yo! Might be time to call up Iron Mountain to keep that data safe, or if you not that crae crae, just get a external hard drive or two to back that data up. Some recommend using cronjobs with dd, others systemd-timers with dd, the GUI script kiddies timeshift. Do your own research, see what fits you. Me personally, I’m probably going with timeshift cause I’m lazy and I got stuff to do, like installing Windows on a system76 computer. Although be advised if you automate backups: make sure to set them at a time where you won’t be doing important work such as running sudo rm -rf /* to get more FPS in Tetris, or when the backup won’t be interrupted. If the pharmacy ran out of OCD medication, then you can hook up a UPS and/or perhaps a KVM to make sure that your computer won’t turn off and that you can turn it on remotely to get that backup chugging along.

  3. If you are truly crae crae and your experience keeps you up at night, consider using the --one-file-system argument on every rm command you run to make sure that no other partitions will be granted extra disk space for free. Yeah homie, the deal may sound appealing, but but believe me brother, the extra yobibyte ain’t worth it.


Anyways, I’ll be marking this post as the solution for those who come by this post with the same issue. If you got anything to add, go ahead and say it and I’ll edit the post.

1 Like

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.