Friday, 17 February 2017

Linux file system


File system in Linux is as follows:-


root     :           it is an home directory of super user (root) administrator
etc       :           it is the location of all configuration file and directory used for server
           Configuration or system configuration
dev      :           it is a location of the device file
home   :           it is a location of home directory or regular users
proc     :           it is a virtual file system or directory not actually store on the disk and
            contain system information
                        # cat /proc/meminfo
                        # cat /proc/cpuinfo
boot     :           contain kernel and boot related files
sys       :           it is also a virtual directory and contain system information
media  :           it is a mount point of removable disk like cdrom floppy usb drive etc.
tmp     :           it contain all temporary file
usr       :           it is used for software installation
lib        :           it contain all library files
bin       :           it is the location of all executable files or command or user command
/usr/bin also contain user command
sbin     :           it contain all system command or super user command /usr/sbin
mnt     :           it is a mount point for physical hard-disk or partition
opt       :           optional directory and used for temporary working
var      :           it is a variable file system or directory and contain all log and error
message

File system type:

Dos                  :           Fat 16
95/XP/2000   :           FAT32
XP/NT/2000:           NTFS
Linux              :           EXT2, EXT3
UNIX              :           VXFS

Representation Of Media Devices::  

The entire device files are stored in /dev/

Hard disk       ; /dev/hdx
Where x is
a          :           /dev/hda       :           Primary master
b          :           /dev/hdb       :           Primary slave
c          :           /dev/hdc       :           Secondary master
d          :           /dev/hdd       :           Secondary slave

In case of SCSI, Sata or USB we will use : /dev/sda

CD-rom:
            /dev/cdrom
            /dev/cdrom1
            /dev/cdrecorder

Floppy:
            /dev/fd0
            /dev/fd1

to access partition of windows in linux
#mount –t vfat /dev/hdax /mnt
in order to check the label of any partition
#e2label /dev/hdax
where x is number

Mounting CD Rom:-
# mount –t auto /dev/hdc /media/cdrom
-t : file type
auto : file type
in order to check where cdrom is attached we can open the file fstab
#vi /etc/fstab
now in case of RHEl 3.0 we have to use command in order to unmount.
# umount /media/cdrom
and then eject the cdrom
in case of RHEL 4.0 we simply type
# eject

Mounting Floppy:-
#mount –t auto /dev/fd0 /media/floppy

in case of floppy we have to umount first then only we remove floppy otherwise all content of floppy may be lost or floppy may be physically damaged.
# umount  /media/floppy
Mounting USB media: - directed by the kernel as SCSI device
/dev/sdax
vi Editor:
Using vi , we can create or modify any file.


No comments: