Fsck.ext3: Unable to resolve UUID
If you are getting the FSCK error fsck.ext3: Unable to resolve ‘UUID=”0415c1ac-8f7a-49e3-9638-bbab4ceefe9b”‘ on system booting, then you can try following steps to resolve that.
1. Use following command to get the UUID of current partitions.
blkid
2. Open the /etc/fstab file and check the UUID in the fstab and the result of blkid are same.
$ sudo blkid |grep /dev/sda
/dev/sda1: TYPE=”swap” UUID=”0415c1ac-8f7a-49e3-9638-bbab4ceefe9b”
/dev/sda2: LABEL=”Dreamlinux” UUID=”5845b99a-14e0-4bd5-b17a-05a8085b16f3″ TYPE=”ext3″
3. Edit the /etc/fstab and change the UUID to that got from the blkid
That will solve the issue.
Tags: Fsck
How to disable the the stats services(Analog or Awstats or Webalizer stats)
You can disable Analog or Awstats or Webalizer stats in a cpanel server via backend by editing the file “/var/cpanel/cpanel.config”.
Check for the variables skipanalog, skipawstats, skipwebalizer in the file and change the values of the variables to one. Now the variables should look like as follows:
skipanalog=1
skipawstats=1
skipwebalizer=1
Save the changes and restart the cpanel service in the server.
/etc/init.d/cpanel restart
Now the all the three stats will be disabled server wide.
Tags: stats
Find text in a large number of files
If you need to find a string in a file, you would typically use:
grep -H “string” file-name.ext
However, grep doesn’t handle a large number of files well. If you specify grep “string” * or even grep “string” `find ./`you may find yourself facing this error:
bash: /bin/grep: Argument list too long
Simple bash script to do the searching.
In this sample, We will be looking for a string “welcome” in a directory named “./Document/”:
for i in `find ./Document/`; do grep -H “welcome” $i; done
This uses the find command to do the searching. It actually returns a list of filenames, which we can then grep one-by-one. The -H option tells grep to let us know the filename it found the string in so we can go right into that file to find the location of it.
Tags: Files, find, text
Enable quotas in cpanel server
If quotas are not enabled for the partition, the following error will occur while doing a quotacheck in the server. In case of Cpanel server, /scripts/initquotas will throw the following error.
/scripts/initquotas
Quotas are now on
Updating Quota Files……
quotacheck: Can’t find filesystem to check or filesystem not mounted with quota option.
quotacheck: Can’t find filesystem to check or filesystem not mounted with quota option.
….Done
You need to follow the steps given below:
$ touch /quota.user /quota.group
$ chmod 600 /quota.*
$ mount -o remount /
$ quotaoff -a
$ vi /etc/fstab
( open ‘fstab’ file and add usrquota,grpquota to the partition where you want to have quota on. That is, for example, add the entry like:
/dev/ubd0 / ext3 defaults,noatime,usrquota,grpquota 1 0 )
$ quotaon -a
You should be able to run a quotacheck nor /scripts/initquotas in your cpanel server without any problem.
Tags: Enable quotas in cpanel server
Apache Error: Unable to open logs
Sometimes apache will fail to start. It will show the following error message in apache error logs:
Unable to open logs
This is because of the low number of file descriptors. Check the current limit of file descriptors in the file /proc/sys/fs/file-max:
$ cat /proc/sys/fs/file-max
1024
If fs.file-max is quite small (several thousands or so), it should be changed to a higher value.
$ echo “65535″ > /proc/sys/fs/file-max
If you want this new value to survive across reboots you can add it to /etc/sysctl.conf.
# Maximum number of open files permited
fs.file-max = 65535
To load new values from the sysctl.conf file:
$ sysctl -p /etc/sysctl.conf
Hint: Add `ulimit -n 65536` command to /etc/rc.d/init.d/httpd or /etc/init.d/httpd and /usr/sbin/apachectl apache startup scripts at the top.
Tags: Apache, Unable to open logs