The Unix File System
A filesystem is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk. The word is also used to refer to a partition or disk that is used to store thefiles or the type of the filesystem.
A filesystem is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk. The word is also used to refer to a partition or disk that is used to store thefiles or the type of the filesystem.
A file system is a group of files and relevant information
regarding them.The disk space alloted to a unix file system is madeup of
'blocks'.
The Boot Block:
This represents the beginning of the file system. It
contains a program called 'bootstrap loader'.
This program is executed when we 'boot the host machine.only one block is needed to start up the system, all file
systems contain one boot block.
The Super Block:
The super block describes the state of the file system-how
large it is how many maximum files can it accomodate, how many more files
can be created.
The Inode Table:
All the entities in unix system are treated as files. The
information related to all these files is stored in an Inode Table on the disk.The
Detailes will be
·
Owner of the file
·
Group to which the owner belongs
·
Type of the file
·
File access permissions
·
Date and time
of the last acces
·
Number of links to the file
·
Size of the file
·
Address of the block Where the file actually
present.
Data Blocks:
These contains the actual file contents. An allocated block belong to
one file in the file system. This block cannot be used for storing any other files contents.
How Does unix acces a
file:
Internally a file is identified by the inode number.we can
obtain inode number as follows.
[dhoni@server1 ~]$ ls -i ckt.txt
915756 ckt.txt
# To check disk Free
space
[dhoni@server1 ~]$ df
Filesystem
1K-blocks Used Available Use%
Mounted on
/dev/mapper/VolGroup-lv_root
39645804 866232 36759016
3% /
tmpfs
251020 0 251020
0% /dev/shm
/dev/sda1
487652 29789 432263
7% /boot
vagrant
218488828 69148548 149340280 32%
/vagrant
# To check disk usage
[dhoni@server1 ~]$ du
4 ./dir1
4 ./best
32 .
To set the user limit when creating a file
[dhoni@server1 ~]$ ulimit
unlimited
Key directories in the file system:
Key directories in the file system:
- */: Root directory (base of file system)
- /bin: Executable programs
- /boot: Linux kernel and boot loader
- /dev: Special device files
- /etc: System configuration files
- /home: Home directories of all users
- /lib: Library files for programs
- /media: Mount points for CD-ROM and other media
- /root: Home directory of the root user
- */sbin: System administration commands
- /srv: Data for services such as Web and FTP
- */tmp: Temporary directory
- /usr: Many of the important administration programs
- /var: Various system files, such as logs
No comments:
Post a Comment