Tuesday, March 3, 2009

xrandr to change display resolution setting

xrandr --newmode 1600x1200 229.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
xrandr --addmode default 1600x1200
xrandr --output default --mode 1600x1200

replace 'default' with proper output (xrandr -command should show it. It can be VGA, VGA1, VGA2, LVDS etc...)

if above method fails, you may need to add Virtual 2048 2048 to your xorg.conf. example:

Section "Screen"
Subsection "Display"
Virtual 2048 2048
EndSubsection
EndSection

then restart your x and try xrandr commands again.

XDMCP for remote login

Here's how to enable xdmcp in the terminal server client (tsclient/rdesktop) for Ubuntu (tested under dapper). By default the terminal server client program has xdmcp disabled. To fix this just install xnest:
# apt-get install xnest

Alternatively, if you are looking to enable xdmcp in BOSS:

1. Go to System -> Administration -> Login window (or run gdmsetup).
2. Under the Remote tab change Style to same as local. The different choices just change what login screen the user sees.
3. You will need to restart GDM which will kill your X session.
# kill -HUP `cat /var/run/gdm.pid`

Or if you prefer to edit the files by hand:

1. Edit /etc/gdm/gdm.conf (make sure there is no overriding settings in gdm.conf-custom)
2. Uncomment RemoteGreeter in the daemon section.
3. Under the xdmcp section, change Enable to true.
4. Do step 3 above to restart gdm.

also change setting @security..

Monday, March 2, 2009

logitech webcam

uninstall spca5xx module and then install gspca compiled driver pkg.

PCI cannot allocate resource region one of device 0000:00:14.0

problem in installation of BOSS linux on AMD athlon X2--solution

system was getting hang while installation...

add extra kernel parameter at installation time , noapic nolapic acpi=off irqpoll
and it will install properly.

(tested with extra param like hda=noprobe dma=none io=parallel port addr(0x378/0x278/0x3bc) irq=any in 5-7...but useless try)

Mounting LVM

Mounting an LVM may seem a bit intimidating, it's not. In reality, despite the length of this entry, you will only be running a handful of commands, and most of those just to get the needed information. Do not despair, this will be as painless as possible. All of these commands will be run as root from a terminal. Please also remember that your volume names may differ from the guide, please make sure to adjust accordingly.

# pvs

This should give you an output similar to

sabayonx86 sabayonuser # pvs

PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 7.88G 32.00M

If we look closely we can see that /dev/sda2 holds a lvm that is 7.88 gig in size. In this case, thats the one we want, as it is the only one.

So now we want to see what is actually in that lvm

# lvdisplay /dev/VolGroup00

sabayonx86 sabayonuser # lvdisplay /dev/VolGroup00


--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID SWp2V0-1xPU-0tOP-UnPs-snxF-THUl-pZMKb2
LV Write Access read/write
LV Status available
# open 0
LV Size 6.88 GB
Current LE 220
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID MGBeJP-ohrX-KLju-5V78-iJOi-pP3w-huaOmC
LV Write Access read/write
LV Status available
# open 0
LV Size 992.00 MB
Current LE 31
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:1

We are looking for two things out of that list. LV name and LV Size. We have one that is 6.88 GB and one that is 992 MB. We can safely assume that the smaller of the two is /swap so the larger must be our real filesystem. That one is named /dev/VolGroup00/LogVol00.

So now we have all the information that we need. We need only to make a mount point and actually mount the volume.

# cd /mnt
# mkdir lvm
# vgscan --mknodes
# lvchange -ay /dev/VolGroup00/LogVol00
# mount /dev/VolGroup00/LogVol00 /mnt/lvm

If all went well then can now get inside and look around, make changes, chroot in, or whatever caused us to want to mount the LVM in the first place.

Monday, January 26, 2009

webmin installation in debian

Webmin is a web-based interface for system administration for Unix. Using any browser that supports tables and forms (and Java for the File Manager module), you can setup user accounts, Apache, DNS, file sharing and so on.

Webmin consists of a simple web server, and a number of CGI programs which directly update system files like /etc/inetd.conf and /etc/passwd. The web server and all CGI programs are written in Perl version 5, and use no non-standard Perl modules.


download webmin from this site
http://www.webmin.com/download.html
install it
#dpkg -i webmin_1.441_all.deb
You should now be able to login to Webmin at the URL https://localhost:10000/

Webmin User Password Change

If you want to change root password in webmin use this included Perl script:

sudo /usr/share/webmin/changepass.pl /etc/webmin root

If you want to install any standard modules you can download from
http://www.webmin.com/standard.html
If you want to install third party modules you can download from
http://www.webmin.com/third.html

Saturday, January 24, 2009

Q. How can I Recover a bad superblock from a corrupted ext3 partition to get back my data?

Q. How can I Recover a bad superblock from a corrupted ext3 partition to get back my data? I'm getting following error:

/dev/sda2: Input/output error
mount: /dev/sda2: can't read superblock

How do I fix this error?

A. Linux ext2/3 filesystem stores superblock at different backup location so it is possible to get back data from corrupted partition.
WARNING! Make sure file system is UNMOUNTED.

If your system will give you a terminal type the following command, else boot Linux system from rescue disk (boot from 1st CD/DVD. At boot: prompt type command linux rescue).

Mount partition using alternate superblock

Find out superblock location for /dev/sda2:
# dumpe2fs /dev/sda2 | grep superblock
Sample output:

Primary superblock at 0, Group descriptors at 1-6
Backup superblock at 32768, Group descriptors at 32769-32774
Backup superblock at 98304, Group descriptors at 98305-98310
Backup superblock at 163840, Group descriptors at 163841-163846
Backup superblock at 229376, Group descriptors at 229377-229382
Backup superblock at 294912, Group descriptors at 294913-294918
Backup superblock at 819200, Group descriptors at 819201-819206
Backup superblock at 884736, Group descriptors at 884737-884742
Backup superblock at 1605632, Group descriptors at 1605633-1605638
Backup superblock at 2654208, Group descriptors at 2654209-2654214
Backup superblock at 4096000, Group descriptors at 4096001-4096006
Backup superblock at 7962624, Group descriptors at 7962625-7962630
Backup superblock at 11239424, Group descriptors at 11239425-11239430
Backup superblock at 20480000, Group descriptors at 20480001-20480006
Backup superblock at 23887872, Group descriptors at 23887873-23887878

Now check and repair a Linux file system using alternate superblock # 32768:
# fsck -b 32768 /dev/sda2
Sample output:

fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
/dev/sda2 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong for group #241 (32254, counted=32253).
Fix? yes

Free blocks count wrong for group #362 (32254, counted=32248).
Fix? yes

Free blocks count wrong for group #368 (32254, counted=27774).
Fix? yes
..........
/dev/sda2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda2: 59586/30539776 files (0.6% non-contiguous), 3604682/61059048 blocks

Now try to mount file system using mount command:
# mount /dev/sda2 /mnt
You can also use superblock stored at 32768 to mount partition, enter:
# mount sb={alternative-superblock} /dev/device /mnt
# mount sb=32768 /dev/sda2 /mnt
Try to browse and access file system:
# cd /mnt
# mkdir test
# ls -l
# cp file /path/to/safe/location

You should always keep backup of all important data including configuration files.
http://www.softpanorama.org/Internals/Filesystems/linux_ext2_ext3.shtml

fingerprint reader in debian+IBM integrated fingerprint reader

http://linux.spiney.org/debian_gnu_linux_on_an_ibm_thinkpad_t43p_fingerprint_reader
http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader

Friday, January 23, 2009

kernel compilation for supporting more than 1 GB RAM size

Memory Size

This is the main reason you should know how to compile a kernel. Some default kernels will only allow up to 4GB of RAM. Currently I've only noticed this with Fedora Core, Debian and non-servercd CentOS distros. So be sure to browse to the following section:

Processor type and features --->
(And look for...)
High Memory Support (4GB) --->

Change this to 64MB to allow for 4GB and higher RAM.