Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, January 30, 2009

Checking Linux version

How to check which Linux version/release is running on your Linux machine:

- on Redhat:
$ more /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

- on Debian:
$ cat /etc/debian_version
4.0
-- OR --
$ cat /etc/issue
Debian GNU/Linux 4.0 \n \l
-- OR --
$ cat /proc/version
Linux version 2.6.24.7-metacarta-appliance-1 (root@ben-bulben) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #2 SMP Thu Jul 24 04:59:24 EDT 2008
(NOTE: in the latter case, it shows Debian 4.1.1 rather than 4.0. Which one is correct?)
-- OR -- (as another source mentioned, but doesn't work in my case)
$ lsb_release -a, OR
$ cat /etc/lsb-release

The following are just copy-pasting for easy reference. I don't have Linux installation from these distros to verify:

- on Fedora:
$ cat /etc/redhat-release

- on Ubuntu:
$ cat /etc/issue
$ lsb_release -a

That's all.. :)

Source:
http://www.debianadmin.com/find-your-debian-or-ubuntu-linux-version-you-are-running.html
http://www.go2linux.org/find-debian-ubuntu-version-you-are-running
http://sysdigg.blogspot.com/2007/12/how-to-check-linux-releaseupdate-in.html

Friday, January 16, 2009

Mount Solaris to Linux (NFS)

In Solaris (the NFS server):
- Edit file /etc/dfs/dfstab, add line like this (refer to 'man share' for more options):
share -F nfs /sourcedir
- Edit file /etc/dfs/sharetab, add line like this:
/sourcedir - nfs rw
- Restart NFS server after adding entry to the file:
/etc/init.d/nfs.server stop
/etc/init.d/nfs.server start
(or, in another reference: svcadm restart nfs/server)
- Verify the updated NFS share by running dfshares or exportfs (both files are located in /usr/sbin)

In Linux (the NFS client):
- Create the mount point:
mkdir /targetdir
- Mount the shared directory in NFS server:
mount -t nfs sunserver:/sourcedir /targetdir
- Check now if you can access the mounted directory:
cd /targetdir
- To automatically mount the shared directory every time the server starts, add the following line to /etc/vfstab:
sunserver:/sourcedir — /targetdir nfs — yes — ro
- Either reboot the system, or run mountall (it reads the /etc/vfstab file and mounts all)

Source:
http://nfs.sourceforge.net/nfs-howto/ar01s08.html
http://www.linuxselfhelp.com/HOWTO/NFS-HOWTO/interop.html

http://sharetab.com/solaris-setting-up-nfs-network-file-sharing-server/

Other:
To mount from a Linux server to Solaris client, check this: http://blogs.sun.com/macrbg/entry/solaris_nfsv4_client_mount_from