Thursday 11 December 2008

Terminal Services Manager fails to list sessions on TS server(s) in the same domain

The symptom is that if you start Terminal Services Manager (aka. TSM) and double-click on another server of your domain in the list (to get the list of sessions on that TS server), then that server simply disappears from the server list, or just appears with a red "cancel" icon.

For me the problem was solved only by starting the "Remote Registry" service (since it was stopped) on the TS server.

Wednesday 10 December 2008

Linux NFS Export / share directory to other UNIX / Linux computer

NFS (Network file system) is both a protocol and file system for accessing and sharing file systems across a computer network using UNIX and Linux. NFS v4 is used in modern Linux distributions. It offers performance improvements, mandates strong security, and introduces a stateful protocol etc.

How do I export a directory with NFS?
NFS server configuration

In order to export or share directory called /data2, you need to edit a file called /etc/exports. The file /etc/exports serves as the access control list for file systems which may be exported to NFS clients.:

# vi /etc/exportsAdd config directive as follows:/data2 *(rw,sync)

Each line contains an export point and a whitespace-separated list of clients allowed to mount the file system at that point. Each listed client may be immediately followed by a parenthesized, comma-separated list of export options for that client.

Where,

rw - Allow both read and write requests on /data2 NFS volume
sync - Reply to requests only after the changes have been committed to stable storage

Save and close the file. Restart the nfs service:# /etc/init.d/nfs restart

NFS client configuration

Client computer need to mount file system using mount command or /etc/fstab file, enter:

# mkdir /mnt/nfs# mount -t nfs4 nfsserver-name-or-ip:/data2 /mnt/nfs

Read the man page for more configuration options:

$ man exports

How to umount when the device is busy

It happens all the time doesn’t it?
You need to unmount a CD or you want to pack away the external drive but when you try to umount it you get the dreaded “device is busy” message.
Wouldn’t it be great if Linux actually told you what was keeping the drive busy?

# umount /media/disk/
umount: /media/disk: device is busy
umount: /media/disk: device is busy

First thing you’ll do will probably be to close down all your terminals and xterms but here’s a better way.
You can use the fuser command to find out which process was keeping the device busy:

# fuser -m /dev/sdc1/
dev/sdc1: 538
# ps auxw | grep 538
johnd 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox


Another handy one is:

umount -l /dev/sdc1

This does a lazy umount which immediately detaches the drive from the filesystem, and then cleans up everything afterwards.
This is especially handy if it’s a networked file system (NFS etc) and the network has gone down.


You can also use:

umount -lfr /mnt/sambamountofboxthatsshutdown

l for lazyness, f for forced unmount for unreachable networked storage, r for just in case unmounting fails remount as readonly

Mount an ISO file

It is convenient to mount an ISO file directly instead of burning it to a CD first.
This recipe describes the command used to mount an ISO image on a Linux system.

As a requirement, you have to be logged as root.

To mount the ISO image file.iso to the mount point /mnt/test use this command:

mount -o loop file.iso /mnt/test

It will work for a CD or DVD ISO image.

You can also specify the format of the CD:

mount -o loop -t iso9660 file.iso /mnt/test