Unit 1: Linux Basics and Installation - Subjective Questions
CSE105 — Creative Engineering Workshop • Practice Questions with Detailed Answers
20 questions
Define Linux and UNIX. Explain the key differences between them.
Linux is a free, open-source operating system kernel first developed by Linus Torvalds in 1991. When combined with GNU tools and utilities, it forms a complete operating system (often called GNU/Linux).
UNIX is a proprietary, multiuser operating system originally developed at AT&T Bell Labs in 1969 by Ken Thompson and Dennis Ritchie.
Key Differences:
- Cost: Linux is generally free and open-source; UNIX is largely proprietary and commercial (e.g., AIX, HP-UX, Solaris).
- Source Code: Linux source code is freely available; UNIX source code is typically closed.
- Portability: Linux runs on a wide range of hardware (PCs, servers, embedded systems); UNIX is often tied to specific vendor hardware.
- Development: Linux is developed by a global community; UNIX is developed by specific corporations.
- Usage: Linux dominates servers, cloud, and embedded systems; UNIX is used in high-end enterprise servers and workstations.
- Licensing: Linux uses the GPL; UNIX uses proprietary licenses.
Describe the UNIX architecture with a suitable diagram explanation. Explain the role of each layer.
The UNIX architecture is organized in a layered model, with each layer providing services to the layer above it.
Layers of UNIX Architecture:
-
Hardware Layer (Innermost):
- Consists of physical components like CPU, memory, and I/O devices.
- The core resources that the OS manages.
-
Kernel:
- The heart of the operating system that interacts directly with hardware.
- Responsible for process management, memory management, file management, device management, and I/O management.
- Acts as a bridge between applications and hardware.
-
Shell:
- The command interpreter that acts as an interface between the user and the kernel.
- Takes user commands, interprets them, and passes them to the kernel for execution.
- Examples: Bash, sh, csh, ksh, zsh.
-
Application / Utilities Layer (Outermost):
- Contains user programs, utilities, and applications (e.g., text editors, compilers, browsers).
- The layer with which the user directly interacts.
Diagram (conceptual):
+---------------------------+
| Applications/Utilities |
| +--------------+ |
| | Shell | |
| | +--------+ | |
| | | Kernel | | |
| | |Hardware| | |
| | +--------+ | |
| +--------------+ |
+---------------------------+
Each layer only communicates with its adjacent layers, ensuring modularity and security.
What is a Kernel? Explain the main functions performed by the UNIX/Linux kernel.
The Kernel is the core component of the operating system that manages system resources and acts as an intermediary between hardware and software applications.
Main Functions of the Kernel:
- Process Management: Creating, scheduling, and terminating processes; managing CPU allocation among processes.
- Memory Management: Allocating and deallocating memory space; managing virtual memory and paging.
- File System Management: Organizing, storing, retrieving, and managing files and directories.
- Device Management: Controlling communication between hardware devices and software through device drivers.
- I/O Management: Handling input/output operations between the system and peripheral devices.
- Security & Access Control: Enforcing permissions and protecting system resources from unauthorized access.
- Inter-Process Communication (IPC): Enabling processes to communicate and synchronize with each other.
The kernel operates in a protected mode called kernel space, separate from user space where applications run, ensuring stability and security.
Explain the step-by-step procedure for installing Ubuntu on a computer.
Steps to Install Ubuntu:
-
Download Ubuntu ISO: Obtain the latest Ubuntu ISO image from the official Ubuntu website.
-
Create Bootable Media: Use tools like Rufus, balenaEtcher, or Startup Disk Creator to write the ISO to a USB drive.
-
Boot from USB: Insert the USB drive and restart the computer. Access the BIOS/UEFI settings (usually F2, F12, DEL, or ESC) and set the USB drive as the primary boot device.
-
Try or Install: On boot, select "Try Ubuntu" to test without installing or "Install Ubuntu" to begin installation.
-
Select Language and Keyboard Layout: Choose your preferred language and keyboard configuration.
-
Choose Installation Type:
- Normal installation (with additional software) or Minimal installation.
- Option to download updates during installation.
-
Disk Partitioning:
- Erase disk and install Ubuntu (uses entire disk), or
- Something else (manual partitioning for custom setups).
-
Set Time Zone: Select your geographic location.
-
Create User Account: Enter your name, computer name, username, and password.
-
Complete Installation: Wait for files to copy, then restart the system and remove the USB drive.
-
First Boot: Log in with your credentials and start using Ubuntu.
What is Dual Boot Installation? Explain its advantages and disadvantages.
Dual Boot Installation is a configuration where two operating systems (e.g., Windows and Linux) are installed on the same computer, allowing the user to choose which OS to run at startup through a boot loader (such as GRUB).
Advantages:
- Native Performance: Both operating systems run directly on hardware without virtualization overhead, providing full performance.
- Full Hardware Access: Each OS has complete access to system resources like GPU and RAM.
- Flexibility: Allows users to use software specific to each OS.
- Cost-effective: No need for separate machines.
Disadvantages:
- Complex Setup: Partitioning and installation can be risky and complicated for beginners.
- Cannot Run Simultaneously: Only one OS can run at a time; switching requires a reboot.
- Risk of Data Loss: Incorrect partitioning may lead to data loss.
- Boot Loader Issues: Windows updates may overwrite the GRUB boot loader, causing boot problems.
- Disk Space: Requires dedicated disk space for each OS.
Explain the process of installing Linux on a Virtual Machine using VirtualBox.
Installing Linux on VirtualBox:
-
Install VirtualBox: Download and install Oracle VM VirtualBox on the host operating system.
-
Download Linux ISO: Obtain the desired Linux distribution ISO (e.g., Ubuntu).
-
Create a New Virtual Machine:
- Click New and enter a name.
- Select the Type (Linux) and Version (e.g., Ubuntu 64-bit).
-
Allocate Memory (RAM): Assign RAM to the VM (e.g., 2GB or more, depending on host capacity).
-
Create a Virtual Hard Disk:
- Choose Create a virtual hard disk now.
- Select disk type (VDI recommended).
- Choose Dynamically allocated or Fixed size.
- Set the disk size (e.g., 20GB or more).
-
Configure VM Settings:
- Go to Settings > Storage, and attach the Linux ISO to the virtual optical drive.
- Adjust processor count and video memory if needed.
-
Start the VM: Click Start to boot from the ISO.
-
Install Linux: Follow the standard Linux installation steps within the VM.
-
Install Guest Additions: After installation, install VirtualBox Guest Additions for better performance, screen resolution, and shared folders.
Advantage: The virtual machine runs in an isolated environment without affecting the host OS.
Distinguish between VirtualBox and VMware as virtualization platforms.
Both VirtualBox and VMware are virtualization software used to run guest operating systems on a host machine, but they differ in several ways.
VirtualBox:
- Developed by Oracle.
- Free and open-source (GPL license).
- Cross-platform (Windows, macOS, Linux, Solaris).
- Suitable for personal use, learning, and testing.
- Generally lighter but with comparatively lower performance for heavy workloads.
- Uses VDI as its native disk format.
VMware:
- Developed by VMware Inc.
- Offers both free (VMware Workstation Player) and paid (Workstation Pro, ESXi) versions.
- Known for superior performance and stability, especially in enterprise environments.
- Better support for advanced features like snapshots and cloning in paid versions.
- Uses VMDK as its native disk format.
- Widely used in enterprise and data center virtualization.
Summary: VirtualBox is preferred for free personal use and learning, while VMware is favored for professional, enterprise-grade virtualization with higher performance.
What is a Live USB/CD Installation? Explain its uses and benefits.
A Live USB/CD is a bootable storage medium (USB drive or CD/DVD) that contains a complete, functional operating system that can run directly from the media without installing it on the hard drive.
How it Works:
- The OS loads into RAM and runs entirely from the removable media.
- Changes are typically not saved unless persistence is enabled.
Uses:
- Testing an OS: Try a Linux distribution before installing it.
- System Recovery: Repair a corrupted system or recover lost data.
- Troubleshooting: Diagnose hardware or software issues.
- Secure/Private Browsing: Use a clean environment that leaves no traces.
- Installation Media: Serves as the medium to install the OS permanently.
Benefits:
- No Installation Required: Runs without altering the host system.
- Portability: Carry a personal OS on a USB drive.
- Safe Testing: Does not affect the existing OS or data.
- Hardware Compatibility Check: Verify if hardware works before installing.
Limitation: Slower than an installed OS since it runs from removable media, and data is not saved without persistence.
What is Windows Subsystem for Linux (WSL)? Explain its features and advantages.
Windows Subsystem for Linux (WSL) is a compatibility layer developed by Microsoft that allows users to run a native Linux environment directly on Windows without the need for a virtual machine or dual boot.
Features:
- Runs Linux command-line tools, utilities, and applications natively on Windows.
- Supports popular distributions like Ubuntu, Debian, Kali Linux, and openSUSE via the Microsoft Store.
- WSL 2 uses a real Linux kernel running in a lightweight virtual machine for full system call compatibility.
- Allows seamless interoperability between Windows and Linux file systems.
Advantages:
- No Dual Boot Needed: Run Linux and Windows simultaneously.
- Lightweight: Consumes fewer resources than a full VM.
- Developer-Friendly: Ideal for developers who need Linux tools while using Windows.
- File System Access: Access Windows files from Linux and vice versa.
- Fast Setup: Quick and easy to install through Windows features or store.
WSL 1 vs WSL 2:
- WSL 1 translates Linux system calls to Windows calls.
- WSL 2 runs a real Linux kernel in a virtualized environment, offering better performance and full compatibility.
Compare WSL 1 and WSL 2 in detail.
WSL 1 vs WSL 2 Comparison:
Architecture:
- WSL 1: Uses a translation layer that converts Linux system calls into Windows system calls. No real Linux kernel is present.
- WSL 2: Runs a genuine Linux kernel inside a lightweight, managed virtual machine using Hyper-V technology.
Performance:
- WSL 1: Faster access to files stored on the Windows file system (cross-OS file access).
- WSL 2: Significantly faster performance for Linux-native file operations and heavy workloads.
System Call Compatibility:
- WSL 1: Limited compatibility; some system calls are not fully supported.
- WSL 2: Full system call compatibility, allowing more applications (e.g., Docker) to run.
File System Access:
- WSL 1: Excellent performance when working across Windows and Linux files.
- WSL 2: Better within its own Linux file system but slower for cross-OS file access.
Resource Usage:
- WSL 1: Lower memory footprint, no VM overhead.
- WSL 2: Uses a VM but manages resources dynamically.
Summary: WSL 2 is generally recommended for most users due to full compatibility and better performance, while WSL 1 may be preferred for scenarios requiring frequent cross-OS file access.
What is a Desktop Environment in Linux? Explain the features of the GNOME desktop environment.
A Desktop Environment (DE) is a collection of software that provides a graphical user interface (GUI) for interacting with the operating system. It includes components like a window manager, panels, icons, menus, and system utilities.
GNOME Desktop Environment:
GNOME (GNU Network Object Model Environment) is one of the most popular and widely used desktop environments in Linux, and is the default for Ubuntu, Fedora, and Debian.
Features of GNOME:
- Modern & Clean Interface: Simple, elegant, and user-friendly design.
- Activities Overview: A centralized area to search applications, switch windows, and manage workspaces.
- GNOME Shell: The core user interface providing the top bar, notifications, and system status.
- Extensions: Highly customizable via GNOME Extensions.
- Integrated Applications: Comes with apps like Files (Nautilus), GNOME Terminal, and GNOME Software.
- Accessibility: Strong accessibility support for users with disabilities.
- Workspaces: Efficient virtual desktop management.
Drawback: GNOME can be relatively resource-intensive compared to lightweight desktop environments.
Distinguish between the GNOME and KDE desktop environments.
Both GNOME and KDE are popular Linux desktop environments, but they differ in design philosophy and features.
GNOME:
- Focuses on simplicity and minimalism.
- Clean, streamlined interface with limited default customization.
- Uses the GTK toolkit.
- Default desktop for Ubuntu, Fedora, and Debian.
- Generally more resource-intensive.
- Prioritizes ease of use and consistency.
KDE (Plasma):
- Focuses on flexibility and extensive customization.
- Highly configurable interface resembling traditional desktops (like Windows).
- Uses the Qt toolkit.
- Default in Kubuntu, openSUSE, and KDE Neon.
- Comparatively lightweight and efficient in recent versions.
- Offers a rich set of applications (the KDE Applications suite).
Summary Table:
| Feature | GNOME | KDE Plasma |
|---|---|---|
| Toolkit | GTK | Qt |
| Philosophy | Simplicity | Customization |
| Customization | Limited | Extensive |
| Interface | Modern/minimal | Traditional/flexible |
| Resource Usage | Higher | Moderate/Efficient |
Conclusion: GNOME suits users who prefer simplicity, while KDE suits users who want full control and customization.
Explain the history and evolution of the UNIX operating system.
The UNIX operating system has a rich history that shaped modern computing.
History and Evolution:
-
1969: UNIX was developed by Ken Thompson and Dennis Ritchie at AT&T Bell Labs. It was initially written in assembly language.
-
1973: UNIX was rewritten in the C programming language (developed by Dennis Ritchie), which made it highly portable across different hardware.
-
1970s-1980s: UNIX spread to universities and research institutions. Berkeley Software Distribution (BSD) was developed at the University of California, Berkeley, adding networking (TCP/IP) features.
-
1983: The GNU Project was launched by Richard Stallman to create a free UNIX-like operating system.
-
1991: Linus Torvalds developed the Linux kernel, which combined with GNU tools formed a complete free UNIX-like OS.
-
Standardization: POSIX standards were introduced to maintain compatibility across UNIX systems.
Major UNIX Variants:
- System V (AT&T)
- BSD (Berkeley)
- Solaris (Sun/Oracle)
- AIX (IBM)
- HP-UX (Hewlett-Packard)
UNIX's design principles, such as portability, multitasking, and multiuser capabilities, greatly influenced modern operating systems including Linux and macOS.
Describe the important features of the Linux operating system.
Linux is a powerful, versatile operating system known for the following features:
-
Open Source: Source code is freely available, allowing anyone to view, modify, and distribute it under the GPL.
-
Multiuser: Multiple users can access system resources simultaneously without interfering with each other.
-
Multitasking: Capable of running multiple processes/programs at the same time.
-
Portability: Runs on a wide range of hardware platforms from embedded devices to supercomputers.
-
Security: Strong security features including user authentication, file permissions, and encryption.
-
Stability & Reliability: Rarely crashes and can run for long periods without rebooting.
-
Hierarchical File System: Well-organized tree-like directory structure starting from root (
/). -
Shell Support: Provides powerful command-line interpreters (Bash, sh, zsh) for automation and scripting.
-
Networking: Excellent built-in networking capabilities.
-
Free of Cost: Most distributions are available at no cost.
-
Community Support: Large global community providing documentation and support.
These features make Linux ideal for servers, cloud computing, embedded systems, and personal use.
What is a Shell in UNIX/Linux? Explain the different types of shells available.
A Shell is a command interpreter that acts as an interface between the user and the operating system kernel. It accepts commands from the user, interprets them, and passes them to the kernel for execution.
Functions of a Shell:
- Interpreting user commands.
- Program execution and process control.
- Input/output redirection.
- Variable and environment management.
- Shell scripting for automation.
Types of Shells:
-
Bourne Shell (sh): The original UNIX shell developed by Stephen Bourne. Simple and fast but with limited features.
-
Bash (Bourne Again Shell): An enhanced version of the Bourne shell. The most popular default shell in Linux, supporting command history, tab completion, and scripting.
-
C Shell (csh): Developed by Bill Joy. Uses C-like syntax and includes features like aliases and history.
-
Korn Shell (ksh): Developed by David Korn. Combines features of the Bourne and C shells with improved scripting.
-
Z Shell (zsh): A modern, feature-rich shell with advanced auto-completion, theming, and customization (default on macOS).
Summary: Bash is the most widely used shell in Linux due to its powerful features and scripting capabilities.
Explain the precautions and best practices to follow before performing a Dual Boot installation of Linux alongside Windows.
Before performing a Dual Boot installation, it is essential to follow certain precautions to avoid data loss and system issues.
Precautions and Best Practices:
-
Backup Important Data: Always create a full backup of important files before partitioning, as errors can cause data loss.
-
Free Up Disk Space: Ensure sufficient unallocated space is available for the Linux installation (at least 20-30 GB recommended).
-
Disable Fast Startup: In Windows, disable Fast Startup to prevent file system corruption when accessing shared partitions.
-
Disable Secure Boot (if needed): Some distributions require Secure Boot to be disabled in the UEFI/BIOS settings.
-
Understand Partitioning: Plan partitions carefully:
- Root (/) partition.
- Swap partition.
- Optional Home (/home) partition.
-
Install Windows First: It is recommended to install Windows before Linux, so that GRUB can detect Windows and add it to the boot menu.
-
Create Recovery Media: Keep a Windows recovery drive in case the boot loader needs repair.
-
Check Battery/Power: Ensure the laptop is plugged in to avoid shutdown during installation.
-
Note Boot Mode: Confirm whether the system uses UEFI or Legacy BIOS and install both OSes in the same mode.
Following these steps ensures a safe and successful dual boot setup.
Explain the concept of the Linux File System Hierarchy and describe the important directories.
The Linux File System Hierarchy is a standardized tree-like structure that organizes all files and directories, starting from the root directory (/).
Important Directories:
-
/(root): The top-level directory from which all other directories branch. Everything begins here. -
/bin: Essential user binary (executable) files/commands (e.g., ls, cp, mv). -
/sbin: System binaries used for administration (e.g., reboot, fdisk). -
/etc: Configuration files for the system and applications. -
/home: Personal directories of users (e.g.,/home/user). -
/root: Home directory of the root (administrator) user. -
/var: Variable data such as logs, mail, and spool files. -
/tmp: Temporary files created by the system and applications. -
/usr: User programs, libraries, and documentation. -
/dev: Device files representing hardware devices. -
/proc: Virtual file system providing process and kernel information. -
/lib: Shared libraries needed by system binaries. -
/mntand/media: Mount points for temporary and removable storage. -
/boot: Files needed to boot the system, including the kernel and GRUB.
This organized structure ensures consistency and makes system management easier.
Compare the different methods of running Linux: Dual Boot, Virtual Machine, WSL, and Live USB. Discuss the suitability of each.
There are several ways to run Linux, each with its own advantages and suitable use cases.
1. Dual Boot:
- Description: Two OSes installed on the same machine; choose at boot time.
- Pros: Native performance, full hardware access.
- Cons: Only one OS at a time; risk during partitioning.
- Best For: Users needing full performance from both OSes (e.g., gaming, development).
2. Virtual Machine (VirtualBox/VMware):
- Description: Linux runs as a guest OS inside a virtualization software on the host OS.
- Pros: Both OSes run simultaneously; isolated and safe; easy snapshots.
- Cons: Performance overhead; requires significant RAM and CPU.
- Best For: Testing, learning, and running multiple OSes at once.
3. Windows Subsystem for Linux (WSL):
- Description: A compatibility layer to run Linux directly within Windows.
- Pros: Lightweight, fast setup, seamless integration with Windows.
- Cons: Limited GUI support (though improving); mainly command-line focused.
- Best For: Developers needing Linux command-line tools on Windows.
4. Live USB/CD:
- Description: Run Linux directly from a USB/CD without installation.
- Pros: No installation needed; portable; safe testing.
- Cons: Slower; changes not saved without persistence.
- Best For: Testing, system recovery, and troubleshooting.
Conclusion: The choice depends on the user's needs—dual boot for performance, VM for isolation, WSL for development integration, and Live USB for quick testing or recovery.
What is a Boot Loader? Explain the role of GRUB in a Linux system.
A Boot Loader is a small program that runs when a computer is powered on. It is responsible for loading the operating system kernel into memory and transferring control to it, thereby starting the OS.
GRUB (GRand Unified Bootloader):
GRUB is the most commonly used boot loader in Linux systems.
Role and Functions of GRUB:
-
OS Selection: Displays a menu allowing users to choose between multiple installed operating systems (useful in dual boot setups).
-
Kernel Loading: Loads the selected Linux kernel into memory and passes control to it.
-
Initial RAM Disk: Loads the initrd/initramfs required during the early boot process.
-
Boot Parameters: Allows passing parameters and options to the kernel at boot time.
-
Configuration: Controlled by the
/boot/grub/grub.cfgfile (generated from/etc/default/grub). -
Recovery Options: Provides recovery mode and advanced options for troubleshooting.
Boot Process Overview:
- BIOS/UEFI initializes hardware.
- Control is passed to GRUB (boot loader).
- GRUB loads the kernel and initramfs.
- The kernel initializes and starts the init system (systemd).
- The system reaches the login prompt or desktop.
GRUB is essential in multi-boot environments as it manages which OS to load.
Explain the different types of Linux distributions with examples and their common use cases.
A Linux distribution (distro) is a complete operating system built around the Linux kernel, bundled with system tools, libraries, package managers, and often a desktop environment.
Major Categories of Linux Distributions:
1. Debian-based:
- Examples: Debian, Ubuntu, Linux Mint, Kali Linux.
- Package Manager: APT (
.debpackages). - Use Cases: Beginners, desktops, servers, security testing (Kali).
2. Red Hat-based:
- Examples: Red Hat Enterprise Linux (RHEL), Fedora, CentOS, Rocky Linux.
- Package Manager: DNF/YUM (
.rpmpackages). - Use Cases: Enterprise servers, corporate environments.
3. Arch-based:
- Examples: Arch Linux, Manjaro.
- Package Manager: Pacman.
- Use Cases: Advanced users who want full control and a rolling release model.
4. SUSE-based:
- Examples: openSUSE, SUSE Linux Enterprise.
- Package Manager: Zypper (
.rpm). - Use Cases: Enterprise and server environments.
5. Lightweight Distributions:
- Examples: Puppy Linux, Lubuntu, Xubuntu.
- Use Cases: Old or low-resource hardware.
Selection Factors:
- Purpose: Desktop, server, security, or embedded.
- Hardware: Available resources.
- Experience Level: Beginner-friendly (Ubuntu) vs. advanced (Arch).
- Support: Community vs. commercial support.
Choosing the right distribution depends on the user's needs, technical expertise, and intended application.
Define Linux and UNIX. Explain the key differences between them.
Linux is a free, open-source operating system kernel first developed by Linus Torvalds in 1991. When combined with GNU tools and utilities, it forms a complete operating system (often called GNU/Linux).
UNIX is a proprietary, multiuser operating system originally developed at AT&T Bell Labs in 1969 by Ken Thompson and Dennis Ritchie.
Key Differences:
- Cost: Linux is generally free and open-source; UNIX is largely proprietary and commercial (e.g., AIX, HP-UX, Solaris).
- Source Code: Linux source code is freely available; UNIX source code is typically closed.
- Portability: Linux runs on a wide range of hardware (PCs, servers, embedded systems); UNIX is often tied to specific vendor hardware.
- Development: Linux is developed by a global community; UNIX is developed by specific corporations.
- Usage: Linux dominates servers, cloud, and embedded systems; UNIX is used in high-end enterprise servers and workstations.
- Licensing: Linux uses the GPL; UNIX uses proprietary licenses.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →