Linux Interview 3

1: – What command is used to determine which shell you are using?

echo $SHELL

2: – How to find all the files which have been accessed within the last 10 days.

find / -type f -atime -10 > filename.txt

3: – How to check the number of files and disk space used and each user’s defined quotas?

repquota

4: – What command is used to remove the password assigned to a group?

gpasswd -r

5: – What daemon is responsible for tracking events on your system?

syslogd

6: – Name all the directory structure hierarchy in Linux

/root
/boot
/bin
/sbin
/proc
/mnt
/usr
/var
/lib
/etc
/dev
/opt
/srv
/tmp
/media

7: – What does /dev directory contain?

The /dev directory contains all device files that are attached to system or virtual device files
8: – Which is the device file for PS/2 mouse connection.

/dev/psaux

9: – Which is the device file for parallel port (Printers).

/dev/lp0

10: – What does /etc/skell directory contains?

The /etc/skel directory contains files and directories that are automatically copied to a new user’s home directory when a user is created.

11: – What is the difference between ext2 and ext3 file systems?

The ext3 file system is an enhanced version of the ext2 file system.
The most important difference between Ext2 and Ext3 is that Ext3 supports journaling.
After an unexpected power failure or system crash (unclean system shutdown), each mounted ext2 file system on the machine must be checked for consistency by the e2fsck program. This is a time-consuming process and during this time, any data on the volumes is unreachable.
The journaling provided by the ext3 file system doesn’t need a file system check after an unclean system restart/shutdown. The only time a consistency check occurs using ext3 is in certain rare hardware failure cases, such as hard drive failures. The time to recover an ext3 file system after an unclean system shutdown does not depend on the size of the file system or the number of files; rather, it depends on the size of the journal used to maintain consistency. The default journal size takes about a second to recover, depending on the speed of the hardware.
12: – Whats the Linux ext4 file system?

The ext4 or fourth extended filesystem is a journaling file system developed as the successor to ext3. Ext4 filesystem released as a functionally complete and stable filesystem in Linux with kernel version 2.6.28.
Features of ext4 file system:-

  •   Currently, Ext3 supports 16 TB of maximum file system size and 2 TB of maximum file size. Ext4 have 1 EB of maximum file system size and 16 TB of maximum file size.[An EB or exabyte is 1018 bytes or 1,048,576 TB]
  •   Fast fsck check than ext3
  •   In Ext4 the journaling feature can be disabled, which provides a small performance improvement.
  •   Online defragmentation.
  •   Delayed allocation
  • Ext4 uses a filesystem performance technique called allocate-on-flush, also known as delayed allocation. It consists of delaying block allocation until the data is going to be written to the disk, unlike some other file systems, which may allocate the necessary blocks before that step.

13: – How we create ext3 file system on /dev/sda1 disk?

# mkfs –j /dev/sda1

14: – How to convert ext2 filesystem to ext3 file system?

tune2fs –j /dev/

15: – Example to  create ext4 file system?

# mke2fs -t ext4 /dev/DEV
17: – What is the use of sysctl command?

The /sbin/sysctl command is used to view, set, and automate kernel settings in the /proc/sys/ directory.

18: – Describe RAID?

RAID, stands for Redundant Array of Inexpensive Disks. RAID is a method by which same data or information is spread across several disks, using techniques such as disk striping (RAID Level 0), disk mirroring (RAID Level 1), and disk striping with parity (RAID Level 5) to achieve redundancy, lower latency, increased bandwidth, and maximized ability to recover from hard disk crashes.
System Administrators and others who manage large amounts of data would benefit from using RAID technology.
Following are the reasons to use RAID
– Enhances speed
– Increases storage capacity using a single virtual disk
– Minimizes disk failure

19: -Which are the  Different types of RAID ?

RAID 0
RAID 1
RAID 5

RAID 0 works on “striping” technique. In RAID 0 the array is broken down into strips and data is written into strips. RAID 0 allows high I/O performance but provides no redundancy. RAID 0 Array Size is equal to sum of disks in array. If one drive fails then all data in the array is lost.
RAID 1

RAID Level 1 is based on Mirroring technique. Level 1 provides redundancy by writing identical data to each member disk of the array. The storage capacity of the level 1 array is equal to the capacity of one of the mirrored hard disks in a Hardware RAID or one of the mirrored partitions in a Software RAID. RAID 1 provides redundancy means good protection against disk failure. In RAID 1 write speed is slow but read speed is good.

RAID 5

RAID Level 5 is based on rotating parity with striping technique. RAID-5 stores parity information but not redundant data (but parity information can be used to reconstruct data). The storage capacity of Software RAID level 5 is equal to the capacity of the member partitions, minus the size of one of the partitions if they are of equal size. The performance of RAID 5 is based on parity calculation process but with modern CPUs that usually is not a very big problem. In RAID 5 read and write speeds are good.

20: – Which is the command  for creating software RAID’s in Redhat Linux

mdadm

Software RAID can be created during Linux Installation by “Disk Druid”

21: – What is SWAP Space?

When the amount of physical memory (RAM) is full swap is used. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.
22: – How to create SWAP files or Partition?

– Create swap partition or file
– Execute “mkswap”
– Activate swap space by “swapon –a” command
– Add swap entry into /etc/fstab file

23: – create a swap file of size 2 GB with swap file entry in /etc/fstab file?

Use “dd” command to create swap file.
dd if=/dev/zero of=/SWAPFILE bs=1024 count=2
mkswap /SWAPFILE
swapon –a
Edit /etc/fstab file.
/SWAPFILE swap swap defaults 0 0

24: – How to remove the swap file?

Disable the swap file by “swapoff” command.
Remove Swap file entry from /etc/fstab file.
Next remove the swap file by “rm” command.

25: – What is LVM?

LVM stands for Logical Volume Manager. LVM, is a storage management solution that allows administrators to divide hard drive space into physical volumes (PV), which can then be combined into logical volume groups (VG), which are then divided into logical volumes (LV) on which the filesystem and mount point are created.

 

Leave a Reply

Your email address will not be published. Required fields are marked *