Tutorial No. 1
Linux File System
A file system is the method or data structure which is used by the operating system to keep record or track of files on disk partition. Keeping record or tracking files is the way to organize files on disk.
Ext means Extended File System. It was the first created only for Linux. There has been four revisions and each revision has added fairly significant features. The first revision of Ext was a major upgrade from the Minix file system used at the time, but it has not that much features used in today’s computing world. At this time you probably should not use Ext in any machine due to its limitation and age. It also is no longer supported in many distributions.
Ext2 is the Second Extended File System. It is not a journaling file system, and when it was first introduced, it was the first file system to allow for extended file attributes and 2 terabyte of drives because Ext2 does not use a journal, it has less writes applied to the disk. Due to lower write requirements, and hence lower erases, it is ideal for flash memory especially on USB flash drives. Modern SSDs have a increased life span and additional features that can negate the need for using a non-journaling file systems.
Ext3 is Third Extended File System. It is basically just Ext2 with journaling. The aim of Ext3 was to be backwards compatible with Ext2 and therefore disks can be converted between the two without needing to format the drive. The problem with keeping compatibility is many of the limitations of Ext2 still exist in Ext3. The benefit of keeping backwards compatibility is the fact that most of the testing, bug fixes, and use cases for Ext2 also apply to Ext3 making it stable and fast. Use if you need to upgrade a previous Ext2 file system to have journaling. You will probably get the best database performance from Ext3 due to years of optimizations. Not the best choice for file servers because it lacks disk snapshots and file recovery is very difficult if deleted.
Ext4 is Fourth Extended File System. It is just like Ext3 before it, keeps backwards compatibility with its predecessors. As a matter of fact, you can mount Ext2 and Ext3 as an Ext4 file system in Linux and that alone can increase performance under certain conditions. You can also mount an Ext4 file system as Ext3 without ill effects. Ext4 reduces file fragmentation, allows for larger volumes and files, and employs delayed allocation which helps with flash memory life as well as fragmentation. Although it is used in other file systems, delayed allocation has potential for data loss and has come under some scrutiny. A better choice for SSDs than Ext3 and improves on general performance over both previous Ext versions. If this is your distro’s default supported file system, you should probably stick with it for any desktop or laptop you set up. It also shows promising performance numbers for database servers, but hasn’t been around as long as Ext3.
XFS was developed by Silicon Graphics in 1994 for their own operating system. Later on in 2001, it is ported in Linux. It is comparable to Ext4 is some regards as it also uses delayed allocation to help with file fragmentation and does not allow for mounted snapshots. XFS has shown itself to provide good performance with large files and has the ability to be resized, however you are not able to shrink an XFS volume. Good for a media file server because of constant throughput for large files. Most distributions require separate /boot partition because XFS and GRUB can be unpredictable. Performance with small files is not as good as other file systems making it a poor choice for databases, email, and other servers that have a lot of logs. Not as well supported as Ext for personal computers and doesn’t have significant performance improvements or features over Ext3/4.
Comparison between Linux and Windows File System
Windows has two file systems : FAT and NTFS, while Linux has a variety of file systems. Windows is not bootable from a network drive while, Linux is. Linux is totally different from Windows. There is everything either a file or a process in Linux which is totally in contrast with Windows. Major partitions in Linux are called as data partitions and swap partitions. As we face problem of run out of memory in Windows, because of the existence of swap partitions, you never face this problem in Linux. There is same disk-based files into a hierarchy of directories organization both in Windows and Linux. When it viewed in a GUI, such directories are usually called “folders”. One complete hierarchy is called a “file system” on both platforms. The architecture of Windows and Linux file systems is similar at some extents, but it has great difference when tools are considered. Here’s a quick comparison. On hardware produced from Intel or IBM PCs, both Windows and Linux uses the Master Boot Record (MBR). This is the bit of disk used to boot the OS and to state whether the disk is partitioned or not. On both Windows and Linux, it is common to have at most one file system per partition. That is about the end of the similarity. Each Windows file system gets a drive letter, like “C:”. On Linux, each file system gets a device, like /dev/hda1 (“hard disk A part 1”), which is represented as a file. Such a file is a device file (since a disk is a device), hence the “dev” part of the path name. Also, the device file is not an ordinary text file, it is a “special file.” Since disks are block devices (unlike a serial mouse), such a file is fully described as a “block special device file”. The numbered part of the path can be a little weird to get right; it’s best to be guided by documentation there or extract the right name from a report.
On Windows, file systems can be FAT16, FAT32 or NTFS, to name a few. Recall FAT16 is the ancient standard responsible for Windows file names with the “8.3” file name length restriction. On Linux, filesystems can be “minix,” “ext,” or “ext2,” to name a few. Also, “minix” is an example of the ancient standard responsible for UNIX file names once being limited to 14 characters. Linux also has “msdos” and “vfat” file systems for compatibility with Windows and DOS, plus more. Windows uses FORMAT.EXE to format a disk. Linux uses mkfs (“make file system”) in various specialist forms. Each Windows file system has a File Allocation Table (FAT, VFAT, or similar) that states which disk blocks hold the topmost directory. On Linux, the equivalent on most filesystems is the superblock. A Linux file system has multiple copies of the superblock physically saved on the disk. This provides redundancy in case of a partial disk corruption. The superblock is just about always in memory on Linux; that is not the case for ancient DOS-like file systems. There are no special restrictions on files placed in the topmost directory on Linux, either. On Windows, there is one drive letter per mounted file system: for example, C: for C: and D: for D:. On Linux there are no drive letters, so one file system is mounted on “/” and all other file systems are mounted on subdirectories of “/.” This arrangement is like the little-used MS-DOS command SUBST, or the NET USE command that supports Novell‘s NetWare. The equivalent Linux command is “mount.” You can see all this at work on Linux, but for some of it you need to be logged in as root. Type “cat /etc/fstab” to see all the mountable devices, including floppy disks and CD players. Type “df” to see the devices currently mounted, and their free space. In the usual case you can even see the superblock: try “/sbin/dumpe2fs /dev/hda1” where hda1 comes from the output of “df.” The name “dumpe2fs” is a casualty of history; it replaces the older “dumpfs.” The information produced is really just for diagnostic purposes. Mostly file systems work for you silently. If you want to dig into Linux further, then there are plenty of tools that can be used as inspection points.
Tutorial No. 2
Commercial and Open Source Linux Distribution, Linux Boot Process
Q.1) Commercial Linux Distribution
The biggest three commercial Linux vendors are Canonical, Novell and Red Hat. There are some big advantages of using Commercial Linux vendor support for systems. Some of advantages are 24x7 priority support, fixed support costs and experts who know operating system inside and out.
Canonical:- Canonical is the commercial sponsor of Ubuntu Linux. Sponsorship of Canonical includes development of OS, ongoing support for OS and a pledge to keep Ubuntu Linux free to use for all purpose and for all organisation. Canonical is a commercial, for-profit company that provides engineering and development services. It provides 24x7 support for Ubuntu Linux, training, hardware certification and application packaging. Canonical's Standard support offering is 9x5 which is covering your local business hours only. Another one is a deviation from the "norm" of 12x5 support from the other two companies. Its Priority support is far more expensive than the competition, which is sure to be a deterrent to many would-be Ubuntu users.
Novell:- Novell owns SUSE Linux. It develops and supports SUSE Linux, which took the place of its own netware OS. It offers SUSE Linux in two basic flavors which are as follows 1. SUSE Linux Enterprise Desktop and 2. SUSE Linux Enterprise Server. Novell has long history of first rate support and some of best Technical folks in the business.
Red Hat:- Red Hat Linux(RHL) is the world's most popular commercial Linux distribution. IT has an Excellent support, training of Linux OS. The industry's most sought-after technical certification (the RHCE), make Red Hat a competitor that's hard to beat. A quick call to Red Hat's Sales Department gives us the lowdown on its Desktop Support options.
Q.2) Open Source Linux Distribution
The Linux kernel contains some elements lik binary blobs, proprietary code that makes certain hardware run. Many laptops have Wi-Fi or Graphics Cards that don’t run without the manufacturer-supplied firmware. This doesn’t bother many Linux users. If manufacturers don’t want to share their code but want to contribute to Linux, but on the other hand, this is closed source code, and that means users can’t verify what’s going on inside. And therefore Linux Users can use it and run the hardware.
1)Trisquel:- Trisquel is a good place to start learning of Linux. This distribution is based on Ubuntu LTS releases, making it relatively modern. The big difference between Trisquel and Ubuntu is the lack of binary blobs and proprietary software of any kind. Trisquel won’t recommend us to install closed hardware drivers or codecs.
Parabola:- Parabola is Arch Linux with the closed bits removed or replaced. Like Arch, Parabola is what we make it. The website provides us with a text-based installer that gives what we need to make our own custom machine. Parabola is geared towards more advanced users. It’s also for free software lovers who want access to current software.
gNewSense:- As Trisquel is based on Ubuntu, gNewSense derives from Debian. This gives us an idea what to expect from each one. Where the former has its own theme and layout, the latter is pretty vanilla. The similarities between gNewSense and Debian don’t stop there. Since Debian uses old but stable versions of software, gNewSense does the same. The “advantage” over Debian is the removal of any references to closed source software.
BLAG:- BLAG stands for the Brixton Linux Action Group. BLAG is Fedora-based alternative to Trisquel and gNewSense. BLAG is also described as Fedora with binary blobs removed.
Q.3) Linux Boot Process
The following are the 6 high level stages of a typical Linux boot process.
BIOS- Basic Input/ Output System executes MBR
MBR- Master Boot Record executes GRUB
GRUB- Grand Unified Bootloader executes kernel
Kernel- kernel executes /sbin/Init
Init- Init executes Runlevel program
Runlevel- Runlevel programs are executed from etc/rc.d/rc*.d.
1. BIOS:- BIOS stands for Basic Input/Output System. Function performed by BIOS are as follows:- It performs some system integrity checks. It searches, loads, and executes the boot loader program. It looks for boot loader in floppy, cd-rom, or hard drive. We can press a key during the BIOS startup to change the boot sequence. Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it. So, in simple terms BIOS loads and executes the MBR boot loader.
2. MBR:- MBR stands for Master Boot Record. It is located in the first sector of the bootable disk. Typically /dev/hda, or /dev/sda. MBR is less than 512 bytes in size. This has three components
1) primary boot loader info in first 446 bytes.
2) partition table info in next 64 bytes.
3) MBR validation check in last 2 bytes.
It contains information about GRUB. So, in simple terms MBR loads and executes the GRUB boot loader.3. GRUB:- GRUB stands for Grand Unified Bootloader. If you have multiple kernel images installed on your system, you can choose which one to be executed. GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it loads the default kernel image as specified in the grub configuration file. GRUB has the knowledge of the filesystem (the older Linux loader LILO didn’t understand filesystem). Grub configuration file is /boot/grub/grub.conf (/etc/grub.conf is a link to this). So, GRUB just loads and executes Kernel and initrd images.
4. Kernel:- Kernel mounts the root file system as specified in the “root=” in grub.conf. Kernel executes the /sbin/init program. Since init was the 1st program to be executed by Linux Kernel, it has the process id (pid) of 1. Do a ‘ps -ef | grep init’ and check the pid. Initrd stands for Initial RAM Disk. Initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted. It also contains necessary drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.
5. Init:- Looks at the /etc/inittab file to decide the Linux run level. Following are the available run levels ->
0 – halt
1 – Single user mode
2 – Multiuser, without NFS
3 – Full multiuser mode
4 – unused
5 – X11
6 – reboot
Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program.
Execute ‘grep initdefault /etc/inittab’ on your system to identify the default run level
If you want to get into trouble, you can set the default run level to 0 or 6. Since you know what 0 and 6 means, probably you might not do that.
Typically you would set the default run level to either 3 or 5.
6. Runlevel programs:-
When the Linux system is booting up, you might see various services getting started.
Depending on your default init level setting, the system will execute the programs from one of the following directories.
Run level 0 – /etc/rc.d/rc0.d/
Run level 1 – /etc/rc.d/rc1.d/
Run level 2 – /etc/rc.d/rc2.d/
Run level 3 – /etc/rc.d/rc3.d/
Run level 4 – /etc/rc.d/rc4.d/
Run level 5 – /etc/rc.d/rc5.d/
Run level 6 – /etc/rc.d/rc6.d/
Under the /etc/rc.d/rc*.d/ directories, you would see programs that start with S and K. Programs starts with S are used during startup. S for startup. Programs starts with K are used during shutdown. K for kill. There are numbers right next to S and K in the program names. Those are the sequence number in which the programs should be started or killed.Jan. 27, 2017
Tutorial No. 3
Linux Desktop Enviornment and Productivity Softwares
Q.1) Desktop environment in Linux with features.
Following are some Desktop Environments used in Linux.
1.GNOME 3 Desktop
2.KDE Plasma 5
3.Xfce Desktop
4.LXQt Desktop
5.Pantheon Desktop
6.Unity Desktop
1.GNOME 3 Desktop:-
It is most popular desktop environment. It is free and open source, yet powerful and simple.
It is designed to offer linux users exciting computer experience.
It has activities for easy access to basic tasks, and powerful search tools to users to access work at any place.
GNOME 3 latest stable release ships in the following features:-
1. Uses metacity as default window manager.
2. Comes with nautilus as default file manager.
3. Support desktop notifications using a convenient messaging system.
4. Enables on/off switching of desktop notifications.
2. KDE Plasma 5:-
It is well-known, powerful, customized desktop environment.
It is designed to offer linux desktop user absolute control over their desktop.
The latest release in KDE series plasma 5, which has brought in several improvements and features.
It has improved readability as compare to previous versions.
New features in plasma 5 includes:-
1. Dolphin file manager
2. A converged shell
3. Kwin window manager
4. Modernized launchers
5. Improved support for high density display.
3. Xfce Desktop:-
It is modern, open-source, light-weight, easy-to-use, desktop environment for linux.
It is fast and importantly user friendly as well as it requires low resource utilization.
It offers beautiful user interface with the following features:-
1. An application manager
2. Thunar file manager
3. Desktop manager for setting background image, desktop icons.
4. It is highly pluggable
5. xfwm window manager
4. LXQt Desktop:-
It is also free, open source, simple, lightweight and fast desktop environment for BCD and Linux distribution.
Its latest version is LXDE, specifically recommended desktop environment for cloud servers and old machines due to its remarkably low system resources usage such as low CPU and RAM consumption.
It is the default desktop environment on Knoppiz, Lubuntu. Following are some of its features:-
1. Support multiple international langauges.
2. Supports an integrated energy saving components.
3. Supports several keyboard shortcuts.
4. A simple and beautiful user interface.
5. lxsession session terminal.
5. Pantheon Desktop:- It is simple and well-designed desktop environment for elementary OS, a windows and MacOS like Linux distribution. It offers users a clean and organized desktop environment. Due to its simplicity, Pantheon comes with not many visually observable features as compare to all other popular desktop environment.
6.Unity Desktop:-
It is graphical desktop shell for GNOME desktop environment.
The unity project was started by Marks, Shuttleworth and Canonical, the markers of well-known Ubauntu linux distribution.
Unity isnot totally new desktop environment, it is an interface to existing GNOME applications and libraries, with various technologies integrated in it.
Unity comes with some features:-
1. A system dashboard
2. Nautilus file manager
3. Offers an application indicator
4. Compiz window manager
5.860 System indicator that provide information about system setting such as power, sound, current session.
Q.2) Productivity software used in linux.
Productivity Software is a category of application programs that help users produce things such as documents, databases, graphs, worksheets and presentations. Many productivity applications are intended for business use.
Following are the Productivity Softwares in Linux:-
1. Google app for business:- Google’s office suite include a selection of office productivity tools including enhanced-for-business purpose versions of Gmail, Google, Talk, Google Calender, Google Docs, Google sites and Google Video. Several pricing options are available, based on our business and limited time free trial is also available.
2. LibreOffice Productivity suite:- This free office productivity suite comes from the not-for-profit organization. The document foundation applications includes Writer, Calc, Impress, Draw, Base and Math. Because it’s free, support comes primarily from the community of users and the developers.
3. OpenOffice:- Another free office productivity suite. The following are the included in this suite: Writer, Calc, Impress, Draw, Base and Math. Oracle is the primary contributor of code to OpenOffice. But other major companies also contribute. For technical support, they offer a forum and a FAQ suite as well as a user guide.
4. Softmaker:- This office productivity suite includes text maker(word processing), Planmaker(spreadsheet) and presentations. This are multiple versions available including mobile version.
5. NEoOffice:- This is an office suite specifically for MAC OS X. They have even included a mobile version that can be accessed remotely. It is distributed under the GNU General purpose license(GPL). It is funded entirely by users donations.
Feb. 8, 2017