224 votes

Monday morning mistake: sudo rm -rf --no-preserve-root /

Fact is? At this point, there's no simple/easy automatic fix for this. Data recovery is a science and even the basic, common tools need someone to sit down and ensure the data is there. If you're ...
Journeyman Geek's user avatar
48 votes

Monday morning mistake: sudo rm -rf --no-preserve-root /

I've had the same issue but just testing with a harddrive, I've lost everything. I don't know if it'll be useful but don't install anything, don't overwrite your data, you need to mount your hard ...
Octo's user avatar
  • 581
33 votes

How to automate changed config files during apt-get upgrade in Ubuntu 12

You can pass arguments to avoid getting prompts. This works for me; apt-get update apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade apt-get -...
Jossef Harush Kadouri's user avatar
19 votes

100 % inodes in root directory, how to free inodes?

I was experiment the same issue some weeks ago, and this procedure was solve the problem. First, search where is the most space use for i in /*; do echo $i; find $i |wc -l; done Pay attention ...
Carlos Mario Mora Restrepo's user avatar
15 votes

Monday morning mistake: sudo rm -rf --no-preserve-root /

I would try to recover backup machine, where all copies were stored: 1st step - Make a backup of this erased "backup machine" drives with dd comand. 2nd step - Use testdisk to recover files. So lets ...
Abc Xyz's user avatar
  • 608
14 votes

Which Nginx and which config file is used

~# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
Kasinath Kottukkal's user avatar
8 votes

Postfix SSL certificate verification failed issue

Your Ubuntu is very old. It seems your ca-certificates are out of date. Your own certificate is not used if you are sending mails. It is only to receive mails with smtpd. smtp use provided ...
Rainer's user avatar
  • 314
7 votes

How to reset Ubuntu 12.04 iptables to default without locking oneself out?

Wing's answer will be at your rescue when things go wrong with iptables. If you want to reset everything, including alternate tables, NAT, PRE/POST ROUTING, use this script: #!/bin/sh # # rc.flush-...
Sahil Arora's user avatar
5 votes

Find out what high CPU usage apache process is actually doing?

An very easy approach is to use htop. You can sort for the high CPU processes and then use s for strace a process l for lsof to see the open files of a processes L to ltrace. I found that at least ...
abuzze's user avatar
  • 156
4 votes

Why does snmp fail to use its own MIBs?

It seems you do not have snmp installed. Just do sudo apt-get install snmp
Bumbuli's user avatar
  • 41
4 votes

setting debconf selections for keyboard-configuration fails... layout ends up as Afghani

Finally here is the solution and it is so simple but I lost two days to find it :( Solution 1: this will serve to configure the keyboard when you install keyboard-configuration for the first time, or ...
Badr Elmers's user avatar
4 votes

setting debconf selections for keyboard-configuration fails... layout ends up as Afghani

I understand your frustration on this one. Here is how I deal with this in similar context (vagrant provisions), so hopefully the day has come. The key is to use debconf-utils in order to describe ...
Wtower's user avatar
  • 594
4 votes

runit - unable to open supervise/ok: file does not exist

In my case I deleted the lock and pid from the service configuration after stopping the service: # stops the service sv down serviceName # deletes the 'pid' and 'lock' files find -L /etc/service/...
alfredocambera's user avatar
4 votes

Restarting MongoDB automatically if it crashes

I don't think newer versions of MongoDB/Ubuntu use upstart. Here's how I achieved this on Ubuntu 18.04, MongoDB 4.0.2: Open /lib/systemd/system/mongod.service in a text editor: sudo nano /lib/systemd/...
joe's user avatar
  • 153
4 votes

disable a network interface on booting ubuntu

You can add the interfaces that should not come up on boot on a new file /etc/network/interfaces.noboot, then bring them up when needed with: sudo ifup -i /etc/network/interfaces.noboot -v eth1
Michael's user avatar
  • 56
4 votes

scsi_eh_320 process eating +90% cpu on Ubuntu Linux 12.04 64bits

I have the same process on one of my server. I kill it and i delete these files and directories fom /tmp: config.f conf.n \ facebook gameover.so Loader.sh Run.sh scsi_eh_320 They are all done by ...
Luca Guerrini's user avatar
3 votes

Restarting MongoDB automatically if it crashes

Building on the accepted answer (and since I do not have enough rep to comment on it) Respawn is NOT a mongo configuration parameter, it is for the upstart service configuration file. respawn ...
Justin Thyme's user avatar
3 votes

Invalid system activity (sysstat) file on Ubuntu server

I have found this issue when I change my instance type in EC2 to higher one which modified the CPU too. So, because of this there is a issue with sar. Inside /var/log/sysstat/ there are two types of ...
Tripathi29's user avatar
3 votes

runit - unable to open supervise/ok: file does not exist

If you are running ubuntu 18.04 or higher and getting the following error unable to open supervise/ok: file does not exist or if the runsvdir is not showing up in "grep" output then please runit-...
Kumaran's user avatar
  • 151
3 votes

How does one configure UFW to allow private DNS requests, but block DNS requests from internet

In addition to blocking traffic at the UFW I would also limit connections on your DNS server. Assuming you're using BIND, something simliar to this: acl internal {; # Add other ...
Tommiie's user avatar
  • 5,647
3 votes

Correct way to move kvm vm

Detailed Instructions on Copying VMs using blocksync.py These instructions apply to a VM using a LVM provided disk and assumes that Python is on each of the hosts Download the blocksync.py script ...
Dale Carter's user avatar
3 votes

Vagrant Error: Connection timeout. Retrying

The SSH connection timeout during boot phase can happen from different reasons such as: system awaits for user interaction (e.g. share partition is not ready), sshd misconfiguration, firewall ...
kenorb's user avatar
  • 6,589
3 votes

Monday morning mistake: sudo rm -rf --no-preserve-root /

How would you move forward from here? I would swear off using rm for the rest of my life and think that it's madness that trash-cli isn't the default removal command on nix systems. https://github....
Gerry's user avatar
  • 378
3 votes

How to generate self-signed cert for use with Tomcat7

Tomcat needs an certificate stored in an Java key store (jks). Java comes usually with the keytool tool already installed. You should use keytool to generate a self-signed certificate like this: ...
Henrik Pingel's user avatar
3 votes

Risks of not updating an Ubuntu server on a local network?

"Internal only" machines can still get pwned, because some other "internal" machine (or the gateway) gets popped, and the attacker engages in "lateral movement" to discover more resources to abuse, or ...
womble's user avatar
  • 96.6k
3 votes

One development server with Apache with multiple Virtual Host?

We have a similar setup. The one catch is that you'll want to have a whole subdomain for your server. So instead of jdoe.domain.com & bsmith.domain.com, you'll have jdoe.dev.domain.com and ...
Wraezor Sharp's user avatar
3 votes

Postfix SSL certificate verification failed issue

You need to type correct path for CA bundle file. See Postfix TLS Support: The $smtpd_tls_CAfile contains the CA certificates of one or more trusted CAs. The file is opened (with root privileges)...
Egor Vasilyev's user avatar
3 votes

mx record server sending email back to webserver when webserver configured to use mx server to send

You have configured Postfix on your web server to believe that it handles all incoming mail for your domain, by setting myhostname = mydomain.com. With this set, Postfix will always attempt to deliver ...
Michael Hampton's user avatar
2 votes

Where BIND9 saves its cache?

For example in named.conf: options { ... dump-file "/usr/local/etc/namedb/working/named_dump.db"; ... }
Marek Lisiecki's user avatar
2 votes

Create Webmin user for an EC2 Instance

Create a simple user with password having sudo permissions as shown below. You can login to webmin using this user. sudo useradd -g sudo webmin sudo passwd webmin Make sure you choose a strong ...
Drona's user avatar
  • 121

Only top scored, non community-wiki answers of a minimum length are eligible