Posts Tagged Linux
Linux: Disable check disk at start up
Posted by Victor Tong in Linux on October 17th, 2009
E.g. Disable check disk for /dev/sda1
tune2fs -c 0 -i 0 /dev/sda1
Edit /etc/fstab and modify last field to 0 instead of 1 or 2
/dev/sda2 / ext3 defaults 1 0 /dev/sda1 /boot ext3 defaults 1 0Total views: 116 views
Fedora Live CD login as root
Posted by Victor Tong in Linux on September 15th, 2009
Fedora Live CD Default login user is “liveuser”, when I use Live CD for system recovery or maintenance purpose, I will face access denied problem while accessing to different folders.
Following is a way for logging as root by using Fedora Live CD. (I tested this approach on Fedora Live CD 10)
1. Ctrl+Alt+F2
2. Login as root without password
3. cd /etc/pam.d/
4. vi gdm
5. Comment the following line
#auth required pam_succeed_if.so user != root quiet
6. save the change
7. Back to the graphical login screen.
8. You can use root as login user now.
Enjoy it !!
Total views: 858 viewsCheck USB harddisk mounted or not in Linux
Posted by Victor Tong in Linux on July 26th, 2009
Today, I am checking how to use a script to check if USB hard disk is mounted or not in Linux.
After doing research, I developed the following script to check “mount” status.
1. Create a file chk_mount.sh.
2. chmod 755 chk_mount.sh
3. Add the follow content to “chk_mount.sh”.
if mount | grep sdb1 > /dev/null
then
echo "sdb1 mounted"
else
echo "No sdb1"
mount /dev/sdb1 /backup
fi
If sdb1 is mounted, there is no action will be taken.
If sdb1 is not mounted, /dev/sdb1 will be mounted automatically.
You can put this script in cron job and check mount status regularly.
Total views: 42 viewsHow to check disk usage in Linux?
Posted by Victor Tong in Linux on June 21st, 2009
1. Login into Linux
2. Run the following command
3. Type df -h in command prompt

How to check top level folder usage in Linux?
Posted by Victor Tong in Linux on June 21st, 2009
1. Login into Linux
2. cd /
3. du -h –max-depth=1

PostgreSQL tuning (Linux kernel parameters)
Posted by Victor Tong in PostgreSQL on June 21st, 2009
Edit file /etc/sysctl.conf
Add the following lines
kernel.shmmax=2147483648
vm.overcommit_memory=2
kernel.shmmax
1. Around 1/2 of the total system memory
e.g. 4GB system memory, kernel.shmmax = 2 x 1024 x 1024 x 1024
Modify postgresql server effective cache settings
edit /var/lib/pgsql/data/postgresql.conf
effective_cache_size = 1800MB
Total views: 237 views
Comments