Posts Tagged Linux

Linux: Disable check disk at start up

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 0
VN:F [1.5.0_759]
Rating: 0.0/5 (0 votes cast)
Total views: 116 views

,

No Comments

Fedora Live CD login as root

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 !!

VN:F [1.5.0_759]
Rating: 0.0/5 (0 votes cast)
Total views: 858 views

, , ,

1 Comment

Check USB harddisk mounted or not in Linux

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.

VN:F [1.5.0_759]
Rating: 0.0/5 (0 votes cast)
Total views: 42 views

,

No Comments

How to check disk usage in Linux?

1. Login into Linux

2. Run the following command

3. Type df -h in command prompt

Linux df

VN:F [1.5.0_759]
Rating: 0.0/5 (0 votes cast)
Total views: 41 views

,

No Comments

How to check top level folder usage in Linux?

1. Login into Linux

2. cd /

3. du -h –max-depth=1

Linux du

VN:F [1.5.0_759]
Rating: 0.0/5 (0 votes cast)
Total views: 42 views

,

No Comments

PostgreSQL tuning (Linux kernel parameters)

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

VN:F [1.5.0_759]
Rating: 0.0/5 (0 votes cast)
Total views: 237 views

, ,

No Comments