Linux File Systems

Linux File Systems

Q.) What is a file system??

Ans.) It is responsible for storing information on disk and retrieving and updating this information.

Types of File System

1.) Network File System ( They are physically somewhere else, but appear as if they are mounted on one computer.)

    a.) NFS - It was developed by Sun.

    b.) SMB - It was developed by Microsoft.

2.) Disk File System ( They are what you will find on a physical device, such as hard drive in a computer.)

     a.) ext2- ( Standard File System for Linux.)

     b.) ext3- ( Journaling File System for Linux.)

     c.) FAT32

     d.) NTFS

(a.) ext2 File System:-

The ext 2 File System can accommodate:

·      Files as large as 2GB.

·      Directories as large as 2TB.

·      Max. file name length of 255 characters.

·     A file in the ext2 File System begins with the inode.

Physical Structure on the Disk

1.) Boot Block-Information needs to boot the system    

2.) Super Block-File System Specifications

      (a.) Size

      (b.) Max. number of lines

      (c.) Free blocks

      (d.) Free inodes

3.) Inode List-It contains the information required to

                         Access the file. It doesn’t contain

                         Filename.

4.) Block List-The files data.

(b.) ext3 File System:-

1.) It is same as ext2.

2.) It is Journaling File System for Linux.

3.) In Journaling System, metadata is written to a journal on the disk before it is actually used to modify the file.

File System Architecture (/)

1.) /bin

a.) ping

b.) Is

2.) /etc

3.) /dev

4.) /usr

5.) /home

a.) A

·      data.txt

·      pic.gif

 b.) B

6.) /root

1.) /bin – Hold the most commonly used essential user programs.

(a.) login

(b.) shells (bash, ksh, csh)

(c.) File manipulation utilities ( cp, mv, rm, ln, tar)

(d.) Editors ( ed, vl)

(e.) File System utilities ( dd, df, mount, unmount, sync)

(f.) GNU utilities like gzip and gunzip.

2.) /etc – Store the systemwide configuration files required up by many programs.

(a.) passwd

(b.) shadow

(c.) fstab

(d.) hosts

(e.) lilo.cmf

3.) /dev – The special files representing hardware are kept in it.

(a.) /dev/hda1

(b.) /dev/ttyS0

(c.) /dev/mouse

(d.) /dev/fd0

(e.) /dev/fifo1

(f.) /dev/loop2 ……

4.) /usr – Most programs and files directly relating to users of the system are stored. It is in some ways a mini version of the /directory.

(a.) /usr/bin

(b.) /usr/sbin….

5.) /home – The /home directory is where all the home directories for all the users on a system are stored.

6.) /root – The /root directory is where all the home directories for root user system are stored.

Creating File System:-

1.) Once a disk has been partitioned for a specific file system, it is necessary to create a file system on it.

2.) The first process in the DOS world is known as formatting.

3.) In the UNIX world is known as creating a file system.

Create File System Commands:-

1.) mkfs or mke2fs – Make a new ext2 file system.

2.) mk3fs – Make a new ext3 file system.

3.) mkdosfs – Make DOS file system without owning any Microsoft Software.

Some FS Commands and Tools:-

1.) pwd – Where am I??

2.) cd – Changes working directory.

3.) Is – Shows the contents of current directory.

4.) cat – Takes all input and outputs it to a file or other source.

5.) mkdir – Creates a new directory.

6.) rmdir – Removes empty directory.

7.) mv – Moves files.

8.) cp – Copies files.

9.) rm – Removes directory.

10.) gzip and gunzip – To compress and uncompress a file.

11.) tar – To compress and uncompress a file.

12.) fsck and e2fsck – Checks and repairs a Linux file system ( same as scandisk.)

13.) e2label – Displays or change the label of a device.

14.) dd – Converts and copies a file.

15.) df – Reports file system disk space usage.

16.) du – Estimates file space usage.

17.) ln – Makes links between files.

18.) file – Determines file type.

19.) tune2fs – Adds a journal to an existing ext2 File System.

20.)

Converting an ext2 File System to ext3:-

1.) Use the tune2fs utility to add the journal to an existing ext2 File System.

2.) Tune2fs - /j/dev/hda2

3.) Edit the appropriate line in /etc/fstab and change the value from ext2 to ext3

Partition Table:-

1.) MBR ( Master Boot Record)

(a.) The first sector.

(b.) 512 bytes (446 bytes: boot loader such as LILO or GRUB, 64 bytes: partition table, 2 bytes: special code.)

2.) The partition table has enough room for four partitions. One of the four can be used as an extended partition.

Partitions:-

1.) Primary-Master - /dev/hda

2.) Primary-Slave - /dev/hdb

3.) Secondary-Master - /dev/hdc

4.) Secondary-Slave - /dev/hdd

5.) Swap Partition – Used to implement virtual memory.

Basic Idea about fdisk ??

1.) The Linux fdisk counterpart in DOS edits the disk structure.

2.) You must be the Superuser (root) to run the fdisk.

   -> fdisk/dev/had

3.) Cfisk -> It is the same as fdisk, but it gives a graphical interface at the console.

要查看或添加评论,请登录

Robin Sharma的更多文章

社区洞察

其他会员也浏览了