Linux: Should You Use Twice the Amount of Ram as Swap Space?

Posted on in Categories data center, Debian Linux, fedora linux, File system, FreeBSD, Gentoo Linux, kernel, Linux, Linux desktop, Linux laptop, OpenBSD, RedHat/Fedora Linux, Solaris, Storage, Suse Linux, Tuning, Ubuntu Linux, UNIX last updated June 8, 2017

Linux and other Unix-like operating systems use the term “swap” to describe both the act of moving memory pages between RAM and disk and the region of a disk the pages are stored on. It is common to use a whole partition of a hard disk for swapping. However, with the 2.6 Linux kernel, swap files are just as fast as swap partitions. Now, many admins (both Windows and Linux/UNIX) follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. Let us say I’ve 32GB RAM, should I set swap space to 64 GB? Is 64 GB of swap space required? How big should your Linux / UNIX swap space be?

Virtualization: Run Windows and Linux at One Place

Posted on in Categories Howto, Linux, Linux desktop, Linux Virtualization, Windows last updated January 24, 2008

I’ve used VMWARE ESX / Xen paravirtualization, Virtuozzo, Solaris Containers, and FreeBSD Jails as os level virtualization. Virutalbox is another full virtualization solution. Presently, VirtualBox runs on Windows, Linux and Macintosh hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista), DOS/Windows 3.x, Linux (2.4 and 2.6), and OpenBSD.

Virtualization: Run Windows and Linux at One Place

Rakesh has published a small article about VirtualBox Virtualization software. Both Windows and Linux can be run together simultaneously, and you don’t even need to switch between the two. With the seamless Windows feature of the latest version of VirtualBox virtualization software, you can seamlesssly run both Windows and Linux applications from the same desktop interface. This has been made possible by the combined efforts of VirtualBox and SeamlessRDP that is meant for seamless Windows support for rdesktop.

=> How to run Windows and Linux at one place? [ciol.com]

Mac ZFS Source Code Released

Posted on in Categories Download of the day, OS X, Solaris, Sys admin, Tips, UNIX last updated January 14, 2008

ZFS has amazing feature set and now it is ported to Mac

ZFS file system developed by Sun for its UNIX operating system. ZFS presents a pooled storage model that completely eliminates the concept of volumes and the associated problems of partitions, provisioning, wasted bandwidth and stranded storage. Thousands of filesystems can draw from a common storage pool, each one consuming only as much space as it actually needs. The combined I/O bandwidth of all devices in the pool is available to all filesystems at all times.

Apple has ported ZFS from Open Solaris to the Mac OS X platform. You can download ZFS beta version here (via ./).

Download of the day: Project Indiana OpenSolaris Developer Preview ISO

Posted on in Categories Solaris, UNIX last updated November 1, 2007

Project Indiana is working towards creating a binary distribution of an operating system built out of the OpenSolaris source code. The distribution is a point of integration for several current projects on OpenSolaris.org, including those to make the installation experience easier, to modernize the look and feel of OpenSolaris on the desktop, and to introduce a network-based package management system into Solaris.

The resulting distribution is a live-CD install image, and is fully permissible to be redistributed by anyone. It will also have the capability for developers to create their own, customized distribution based on Project Indiana.

Now the first preview version is available. This is an x86-based LiveCD install image, containing some new and emerging OpenSolaris technologies. This may result in instabilities that lead to system panics or data corruption.

Among the features contained in this release are:

  • Single CD download, with LiveCD ‘try before you install’ capabilities
  • Caiman installer, with significantly improved installation experience
  • ZFS as the default filesystem
  • Image packaging system, with capabilities to pull packages from network repositories
  • GNU utilities in the default $PATH
  • bash as the default shell
  • GNOME 2.20 desktop environment

Download Project Indiana OpenSolaris Developer Preview ISO

=> Visit the official site to grab ISO file

Comparison: Linux and UNIX ~ ZFS vs XFS vs EXT4 filesystem

Posted on in Categories File system, Linux, Sys admin, Tips, UNIX last updated August 30, 2007

This is an interesting filesystem comparison. If you are looking to build cheap storage for personal use file system decision is quite important:

This is my attempt to cut through the hype and uncertainty to find a storage subsystem that works. I compared XFS and EXT4 under Linux with ZFS under OpenSolaris. Aside from the different kernels and filesystems, I tested internal and external journal devices and software and hardware RAIDs. Software RAIDs are “raid-10 near2” with 6 disks on Linux. On Solaris the zpool is created with three mirrors of two disks each. Hardware RAIDs use the Areca’s RAID-10 for both Linux and Solaris. Drive caches are disabled throughout, but the battery-backed cache on the controller is enabled when using hardware RAID.

=> ZFS, XFS, and EXT4 filesystems compared

Download sun java GPL'd source code

Posted on in Categories Beyond nixCraft, News last updated November 13, 2006

Yet another victory for Open Source software! Woot!!

First Solaris (OpenSolaris) and OpenOffice.org was made open source and now Java. Thanks to Linux (other open source oses) and open source movement.

Sun Microsystems Inc. said on Monday that it will make its Java software available for free to the open-source community, though it will continue to sell and support standardized versions of the product.

Read more lycos news

=> OpenJDK Source Releases/Download link (includes Java programming language compiler source, jtreg test harness for the JDK test framework and Java HotSpotVirtual Machine source under GPL version 2.0)

=> Check out David Herron’s Blog for more info and slashdot thread 🙂

It is time to learn Java!

Howto: Linux write (burn) data to DVD or DVD/RW

Posted on in Categories Howto, Linux, RedHat/Fedora Linux, Ubuntu Linux last updated July 8, 2006

In order to write DVD/DVD-RW from shell prompt you need to install a package called dvd+rw-tools.

DVD is another good option for backup, archiving, data exchange etc. You can install dvd+rw-tools with following commands. Also note that this package works under *BSD, HP-UX, Solaris and other UNIX like operating systems.

Debian installation:
# apt-get install ‘dvd+rw-tools’

Fedora Core Linux installation:
# yum install ‘dvd+rw-tools’

RedHat Enterprise Linux installation:
# up2date ‘dvd+rw-tools’

In order to write DVD you need to install cdrecord tools.

How do I write DVD?

You need to use growisofs command, which combined mkisofs frontend/DVD recording program. From growisofs man page, “growisofs was originally designed as a frontend to mkisofs to facilitate appending of data to ISO9660 volumes residing on random-access media such as DVD+RW, DVD-RAM, plain files, hard disk partitions. In the course of development general purpose DVD recording support was implemented, and as of now growisofs supports not only random-access media, but even mastering of multiession DVD media such as DVD+R and DVD-R/-RW. In addition growisofs supports first-/single-session recording of arbitrary pre-mastered image (formatted as UDF, ISO9660 or any other file system, if formatted at all) to all supported DVD media types.

First create the ISO image
# mkisofs -r -o /tmp/var-www-disk1.iso /var/www

Now use the growisofs command to write the ISO onto the DVD:
# growisofs -Z /dev/dvd=/tmp/var-www-disk1.iso

To append more data for same DVD:
# growisofs -M /dev/dvd /tmp/file.1

To format (erase) a DVD:
# dvd+rw-format -force /dev/dvd
OR
# dvd+rw-format -force=full /dev/dvd

The dvd+rw-format command formats dvd disk in the specified dvd drive.

To display information about dvd drive and disk using dvd+rw-mediainfo command:
# dvd+rw-mediainfo /dev/dvd

See also:

Monitoring hard disk health with smartd under Linux or UNIX operating systems

Posted on in Categories Howto, Linux, Monitoring, RedHat/Fedora Linux, Suse Linux, Sys admin, Tips, Ubuntu Linux last updated May 3, 2006

smartd is SMART Disk Monitoring Daemon for Linux. SMART is acronym for Self-Monitoring, Analysis and Reporting Technology (SMART) system built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the reliability of the hard drive and predict drive failures, and to carry out different types of drive self-tests.

smartd works with following operating systems:

  1. Linux
  2. *BSD
  3. Windows
  4. Solaris etc

How do I Install smartd?

However, smartd is not installed by default. Following are distribution specific steps to install smartd:

Debian Linux:
# apt-get install smartmontools
Red hat/Fedora Linux:
# rpm –ivh kernel-utils
OR
# up2date kernel-utils
OR if you are using Fedora Linux
# yum kernel-utils
FreeBSD:
# pkg_add -r -v smartmontools

Before configuring hard disk for SMART monitoring make sure your hard disk is SMART capable:
# smartctl -i /dev/hda
Output:

smartctl version 5.34 [i686-pc-linux-gnu] Copyright (C) 2002-5 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model:     SAMSUNG SV2002H
Serial Number:    0395J1FR904324
Firmware Version: RA100-04
User Capacity:    20,060,651,520 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   6
ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 1
Local Time is:    Tue May  2 15:44:09 2006 IST

SMART support is: Available - device has SMART capability.
SMART support is: Enabled

You can configure the smartd daemon by editing the file /etc/smartd.conf. 

In above output the lines:
SMART support is: Available – device has SMART capability.
SMART support is: Enabled

Indicates that it is SMART capable and it is enabled.

Configure SMARTD

Debian Linux

  • Enable smart by editing /etc/default/smartmontools file.
  • Smart Configuration file: /etc/smartd.conf
  • Start/Stop smart: /etc/init.d/smartmontools start | stop

Red Hat Linux

  • Enable smart by editing /etc/smartd.conf file.
  • Smart Configuration file: /etc/smartd.conf
  • Start/Stop smart: /etc/init.d/smartd start | stop

FreeBSD

  • Enable smart by editing /etc/rc.conf file (add line smartd_enable=”YES”).
  • Smart Configuration file: /etc/smartd.conf
  • Start/Stop smart: /usr/local/etc/rc.d/smartd.sh start | stop

Example

You can put following directives in Smart Configuration file:
(a) Send an email to [email protected] for /dev/sdb:
/dev/sdb -m [email protected]
(b) Read error log:
# smartctl -l error /dev/hdb
(c) Testing hard disk (short or long test):
# smartctl -t short /dev/hdb
# smartctl -t long /dev/hdb

Caution smartd is a monitoring tool not a backup solution. Always perform data backup.

See also:

  • More information on the smarttool see official home page.
  • Read man page of smartd and smartd.conf for configuration help.