Showing posts with label fstab. Show all posts
Showing posts with label fstab. Show all posts

Wednesday, March 9, 2011

Speeding up Disk Performance

We can increase Hard Disk performance by ~40%, and decrease power consumption by Hard Disk, if we provide "noatime,nodiratime" options during partition mounting. Actually what happens is: whenever a file/directory is accessed, its atime "access time" is updated with epoch. These two options prevent these not-so-useful disk accesses. Hence
performance improvement.



The sample mount point (/home) entry in /etc/fstab may look like:


$ cat /etc/fstab | grep home
/dev/sda2 /home ext3 defaults,noatime,nodiratime 0 0

Friday, July 18, 2008

What is Pseudo Terminal (PTY)?

Honestly, I did not know about the Pseudo Terminal before facing a problem. I had overwritten /etc/fstab in Fedora 8. As a result, I was not able to open either Terminal or Konsole. The error, I was getting, was:


Not enough permission for PTY device.



Then, I searched Internet for PTY device, there I found the full form of PTY, which is Pseudo Terminal.

Like the /dev directory, /dev/pts contains entries corresponding to devices. But unlike /dev, which is an ordinary directory, /dev/pts is a special directory that is created dynamically by the Linux kernel.The contents of the directory vary with time and reflect the state of the running system.

The entries in /dev/pts correspond to pseudo-terminals (or pseudo-TTYs, or PTYs). Linux creates a PTY for every new terminal window you open and displays a corresponding entry in /dev/pts.The PTY device acts like a terminal device—it accepts input from the keyboard and displays text output from the programs that run in it. PTYs are numbered, and the PTY number is the name of the corresponding entry in /dev/pts.

Then, I searched for how to open Pseudo Terminal with enough permissions.

Solution: Since I had overwritten the /etc/fstab, the entry to

mount devpts was not present. I then created the following entry in /etc/fstab file.


# file_system mount_point type options dump pass

none /dev/pts devpts (rw,mode=620) 0 0

Friday, May 23, 2008

Enabling Hibernate on Linux

Yesterday, I was thinking to enable hibernate on
my HP-Compaq nc-6400 laptop.
Some prerequisites for enabling hibernate on Linux:

(i). ACPI should be enabled in Linux kernel.
I have compiled kernel 2.6.22.6

(ii) Go to KDE Control Center > Power Control
> Laptop Battery. Then select 'ACPI Config',
click 'Setup Helper Application'. If ACPI
is supported on your PC, you can see that
check boxes are enabled.

(iii) kpowersaved daemon should be installed.

(iv) You should have swap partition >= RAM on your
PC.

I did not have the swap partition. :( Then I thought
to create it. Because swap file cannot act as resume
device. i.e. At the boot time kernel should know the
resume device before file system.

How did I create swap partition? Following are the
steps:

(a) I created 1 GB partition /dev/sda3 from /dev/sda2
using gparted.

(b) I formatted it and made swap.

# mkswap /dev/sda3

(c) To mount it (as swap) automatically at boot time,
it created following entry in /etc/fstab.

/dev/sda3 swap swap defaults 0 0

(d) I then modified /boot/grub/menu.lst , to make /dev/sda3
as resume device.

I changed booting kernel line from
kernel /boot/vmlinuz-2.6.22.6 root=/dev/sda1 ro
to
kernel /boot/vmlinuz-2.6.22.6 root=/dev/sda1 ro resume=/dev/sda3

(e) Then I rebooted the kernel with resume device. Now I
can hibernate (Suspend to disk) my laptop, using kpowersave
available in KDE tray.