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 ...
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 ...
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 -...
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 ...
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 ...
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
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 ...
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-...
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 ...
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
4
votes
Accepted
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 ...
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 ...
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/...
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/...
4
votes
Accepted
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
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 ...
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
...
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 ...
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-...
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 {
192.168.10.0/24;
# Add other ...
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 ...
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 ...
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....
3
votes
Accepted
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:
...
3
votes
Accepted
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 ...
3
votes
Accepted
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 ...
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)...
3
votes
Accepted
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 ...
2
votes
Where BIND9 saves its cache?
For example in named.conf:
options {
...
dump-file "/usr/local/etc/namedb/working/named_dump.db";
...
}
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ubuntu-12.04 × 1023ubuntu × 249
linux × 120
apache-2.2 × 119
nginx × 57
mysql × 47
ssh × 46
networking × 44
amazon-ec2 × 43
iptables × 39
postfix × 31
php × 29
apt × 29
domain-name-system × 25
ssl × 25
php-fpm × 24
kvm-virtualization × 21
amazon-web-services × 19
apache-2.4 × 19
security × 17
php5 × 17
upstart × 16
linux-networking × 15
vps × 15
virtualhost × 14