Accidently ran sudo rm -rf /*

OT but it’s still pretty funny… just realized I made this post 4 days after the 1 year anniversary of when I first installed Manjaro.

Yes, you would have needed to change the boot order in BIOS, most likely.
It’s usually best to install each OS separately, at first (on separate disks), so that one doesn’t interfere with the other.

Then when both are ready, reconnect them both, confidently knowing that boot selection is the only thing to change.

Happy anniversary then. Cheers. :partying_face:

Gollum_Backupses

5 Likes

I’d rather suggest a systemd timer. They are much easier to understand…

Could you repeat that, as if I’m fi… OK, nevermind… :eyes:

1 Like

Okay, imagine you have a special helper who reminds you to do important things like homework or brushing your teeth. In the computer world, we have similar helpers to do tasks at specific times.

Cron jobs and systemd timers are like two different types of these helpers. Cron jobs are like an old, reliable friend who has been helping for a long time. They are good at reminding you about tasks at certain times, but they can sometimes be a bit tricky to set up and manage.

On the other hand, systemd timers are like a new, smart friend who can also remind you about tasks at specific times, but they come with some extra features and are easier to work with. They are designed to be more flexible and provide more information about the tasks they are doing.

So, using systemd timers is like having a new, improved reminder system that can do the same job as the old one but with some extra benefits. It’s like upgrading your reminder helper to make your computer tasks easier and more efficient.

With timeshift you don’t need to bother setting up cron tabs or systemd timers. You only need to have cronie running. You then simply tell timeshift — via its GUI — to make periodic backups, and how often.

Note: By default, timeshift does not back up the home directories, but you can tell it to.

2 Likes

That’s true. Because it uses it’s own cronjobs. And that’s why I converted everything to systemd timers for me. Because I didn’t want another daemon that does the same thing than an already running daemon is doing. And doing well.

1 Like

Well, most users would simply want things to work without having to tinker, and for now, timeshift still uses cronie scripts, and those are what it sets up if you configure automatic backups from within the timeshift GUI. :man_shrugging:

2 Likes

Yeah, I know I’m in the minority with that. But this kind of attitude has served me well for 38 years now, so I’ll stay in the minority.

1 Like

That command would have the same consequences on any distro.

Good luck. This is why you should have backups which are safe from such things ie mounted read only or not mounted at all.

If you had a separate home partition and had included --one-file-system in the command, then your data would be safe.

It’s not a symbolic link and there isn’t a “grub” partition. /boot contains important files (mostly generated though) and, should you be using UEFI, the mount point for the EFI partition (/boot/efi).

1 Like

Sad - and familiar story. I’ve done worse myself… I guess the game’s up, coz it’s an old post now.

I’d say have a go with freshly installed BTRFS goodness and an rsync backup off your main drive.

BTRFS stands for 'Better Fileystem For idiotS… just a reboot to restore your last snapshot… but then when you’re too stupid, and you can’t restore via snapshot, you still have all your main data ready for recovery the slow way.

1 Like

I have to ask…
Did that really work? I was under the assumption you HAVE TO INCLUDE --no-preserve-root for that command to work?
Are you saying this command went through without warnings??

--no-preserve-root
              do not treat '/' specially

--preserve-root[=all]
              do not remove '/' (default); with 'all', reject any
              command line argument on a separate device from its parent

https://man7.org/linux/man-pages/man1/rm.1.html

Or read posts #7 #8 #10 which discuss preserve-root.

1 Like

I got lazy, and called out for it… :smiley:

That is… good to know…

See my earlier post. /* is a glob pattern that is expanded by the shell before being passed to rm (or any other command, see echo /* for example).

The POSIX standard only specifies that the rm command will fail if the operand resolves to the root directory, which is /, not /bin or /boot or anything else in the root directory.

3 Likes

Just like pointing gun at your head and pressing the trigger might kill you? Yeah, valuable info.

Well, I’ve learned something from you as I’d never heard of ext4magic. On the occasions when a folder got accidentally wiped I tried testdisk, but so far it doesn’t seem to work with Linux. Seems to only work with partitions, but not deleted files or folders. But the Windows version of testdisk always seems to work well with both.

As for your issue, I’m afraid it’s re-install time. Take an image of your system using Disks next time while it’s working and just after a system update. Make sure Manjaro works okay after the update before you ever take an image (eg reboot Manjaro first). When you re-install I’d advise making a separate Home partition, which is an install option.

If you’re in UEFI mode I’d advise that your disk is formatted to GPT during installation. But watch out if you have Linux and Windows on the same disk as you will wipe Windows during that process. If you install Linux on a separate disk you should be fine formatting the intended Linux disk to GPT.

@Warp And this time, use btrfs and separate home.
Make sure timeshift is setup and that an update-grub finds them.

That way you would never end up in this situation again. Then you could have used a live iso, chroot, install grub and let grub find the timeshift subvolumes to boot/restore from. Also install kernels if needed.

But a timeshift is not a complete backup!

I read the whole thread now and it seems you are accepting your fate and take it as a learning experience, well done!

Good luck!

And then there are still some people that decides “I don’t believe you! I’m gonna do it, and nothing bad will happen.”

They’re right that nothing bad will happen for humanity.