#partprobe command
Explore tagged Tumblr posts
2daygeek · 6 years ago
Photo
Tumblr media
(via How To Reload Partition Table In Linux Without System Reboot?)
0 notes
2wowthings · 5 years ago
Text
LINUX FILE SYSTEM
LINUX FILE SYSTEM
Linux File System (Directory Structure)
Linux is not the complete OS it is a number of packages built around a kernel. It has too many lines of code invented and developed by Mr. Linux Torvald in 1991. Developers can edit the code as it was released under open source and free for others.
The Linux file system is a mixture of folders or maybe directory. Everything in Linux is FILE. It is in form like a tree structure start with / directory. Each partition under the root directory.
TYPES OF LINUX FILE SYSTEM
ext2 Linux file System
ext3 
Linux file System
ext4 
Linux file System
JFS 
Linux file System
ReiserFS 
Linux file System
XFS 
Linux file System
btrfs 
Linux file System
swap 
Linux file System
ext2 Linux File System
ext2 stands for the second extended file system it was included in 1993.developed to overcome of limitation of the ext file system. It does not have a journaling feature. Maximum individual file size supports from 16 GB to 2 TB and overall ext2 file system size is 2 TB to 32 TB
ext3 Linux File System
ext3 stands for the third extended file system. Introduced in 2001 starting from Linux kernel 2.4.15 and onwards. The main benefit is to allow journalling. It is a dedicated area in the file system where all changes are tracked when the system crash the possibility of file system corruption is less because of the journaling feature. Maximum individual file size supports from 16 GB to 2 TB and overall ext3 file system size is 2 TB to 32 TB. Three types of journaling available in the ext3 file system.
          1 - Journal Metadata and content save in journal
          2 - Ordered Only metadata save in journal, metadata are journaled only after writing the content to disk and this is the default.
          3 - Writeback Only metadata save in journal. Metadata journaled either before or after the content is written to disk.
ext4 Linux File System
ext4 stands for fourth extended file system and it is introduced in 2008. Supports 64000 subdirectories in one directory. Maximum individual file size supports from 16 GB to 16 TB and overall ext4 file system size is 1 exabyte 
1 exabyte = 1024 PB
1 PB = 1024 TB
Here we have the option to switch off journalling features on or off.
JFS Linux file system
JFS is Journaled File System and developed by IBM. It can be an alternative to the EXT file system. 
ReiserFS Linux file system
ReiserFS is an alternative for the EXT3 file system. 
XFS Linux file system
XFS file system considered as high-speed JFS was developed for parallel I/O processing
btrfs Linux file system
btrfs file system is a b tree file system. using for fault tolerance, storage configuration, and many more. 
swap Linux file system
the swap file system is used for memory paging with equal to system RAM size 
LINUX FILE SYSTEM HIERARCHY 
ve Diagram explained itself about all directories 
Linux-file-systen
(Image Credit) Image Source - Google | Image By - Austinvernsonger
Few details of the above diagram  
/ directory ( root directory)
Everything on Linux located under the / directory also known as the root directory. It is similar to windows C:\ directory difference is Linux not having drive letters, on windows, it is D:\ but on Linux another partition under / directory 
/bin directory (user binaries)
This directory contains some of the standards commands of files. this may be useful for all the users also no special root or su permission required.
/sbin directory (system administration binaries)
/sbin directory is similar to the almost /bin directory. It contains essentials system administration commands files. Only run by root or super user.
/etc directory (configuration files)
This directory contains system configuration files. 
/dev directory (device file)
This directory contains device files. These all files associated with the device. Everything in Linux is a file.
/proc directory (kernel and process files)
This directory similar to /dev, It contains a special file that represents system and process information.
/var directory (variable data files)
This directory contains variable data files such as printing jobs.
/tmp directory (temporary files)
All the application store their temporary files in /tmp directory. these can be deleted after the system restarts.
/usr directory (user binaries and read-only data)
This contains user applications software files, libraries for a programming language, document files.
/home directory (users home directory)
This directory is having the home folder for each user created. This also contains users data files and user-specific configuration files 
/boot directory (boot files)
This directory contains Linux boot loader files
/lib directory (essentials shared libraries)
This directory contains libraries needed by essentials binaries in the /bin and /sbin directory 
/opt directory (optional package)
This directory contains subdirectories for optional software package
/mnt directory (temporary mount files)
This directory has system administrator temporary files mounted on /mnt 
/media directory (removable media)
This directory contains subdirectories where removable media device inserted into the computer are mounted 
/srv directory (service data)
It is having data for service provided by the system example website files under /srv (https server)
  We see working in details 
First, we check fdisk command here 
fdisk /dev/sda                  ( checking hard disk by using fdisk command)
We will get output like below 
command (m for help): p             (type p here for cheeking the details)
Gives us all partition details 
/dev/sda1
/dev/sda2
/dev/sda3
like this details about partitions
Now creating new partition we can use option n
type n and hit enter 
assigning cylinder value and partition size 
then save this partition with option w
now changing the partition type using option t
type t hit enter
now select partition number example 9 hit enter
type l for option 
83 is linux file system
type 83 and hit enter 
to check type p and hit enter 
type w for save and hit enter 
Now check fdisk -l /dev/sda     ( it will show us created partition)
The kernel must know this created partition so we use below command to update 
partprobe
and 
kpartx -a /dev/sda; kpartx -l /dev/sda
We can check cat /proc/partition the new partition in this way
CREATING FILE SYSTEM
mkfs.ext4 /dev/sda8       (using this command we define file system type)
OR
mke2fs -j -L data -b 2048 -i 4096 /dev/sda8
here are -L filesystem label
              -j journaling
              -b block size
              -i inode per every 4kb of disk space
LABELING TO LINUX FILE SYSTEM
e2label       
(Using this command we can give a name to file system)
e2label /dev/sda8 data    
(here we have give the name data to /dev/sda8)
If we want to use this new partition we need to mount the partition 
MOUNTING OF NEW LINUX FILE SYSTEM
mount LABEL=data /admin
TO CHECK LABELS AND TYPE OF ALL  FILE SYSTEM
blkid                       (This is the command we can check type of file system)
MANAGE PARAMETERS OF  LINUX FILE SYSTEM
dumpe2fs /dev/sda8             (this show all below details please check example)
file system flags
default mount option
block count
block size 
first block
inode count
last mounted on
UUID
file system magic number  
EXCLUDE FSCK CHECK FOR PARTICULAR LINUX FILE SYSTEM WHILE BOOTING 
tune2fs -i0 -c0 /dev/sda8     (this partition exclude while booting for fsck check purpose)
MOUNT POINT LINUX FILE SYSTEM
We will mount the partition in /etc/fstab file 
device                  mount point    fs type    options        dump_freq    fsck_order
LABEL=data       /admin             ext4       defaults             0                  0
Understand what is this mean
device                  device name 
mount point       path for using access to file system
fs type of file system
options                comma-separated list of different options can use
dump_freq          it is 1=daily, 2=every next day, 0=never dump
fsck_order           0=ignore and 1=first and from 2-9=second,third
             We can use command mount -a and check df -h for checking the mounted partition
DENY ACCESS TO PARTICULAR FOLDER OF LINUX FILE SYSTEM WHICH IS MOUNTED
mount -t ext4 -o noexec /dev/sda8 /admin
INCREASE I/O PERFORMANCE OF LINUX FILE SYSTEM
mount -t ext4 -o noatime /dev/sda8 /admin
UMOUNT LINUX FILE SYSTEM
We need to exit from partition and then need to use below command
umount /admin
CREATING SWAP PARTITION
fdisk -l /dev/sda
Check for the partition available or create using n command for new as we have discussed above 
mkswap /dev/sda10        (creating swap using mkswap the command for sda10)
Update in fstab
vim /etc/fstab
device                  mount point    fs type    options        dump_freq    fsck_order
/dev/sda10               swap             swap       defaults             0                  0
save this file and exit
Now 
swapon -a 
swapon -s 
CREATING SWAP FILE 
dd if=/dev/zero of=/swapfile bs=1024 count=100000  (will create swap file)
Now 
mkswap /swapfile
Update in fstab
device                  mount point    fs type    options        dump_freq    fsck_order
/swapfile               swap             swap         defaults             0                  0
save and exit the file 
swapon -a
swapon -s
Now we have created swap partition as well file 
This is LINUX FILE SYSTEM It is more in deep ANYTHING PLEASE CONTACT ME SUBSCRIBE FOR NEW UPDATES 
THANKS TO ALL GOD BLESS 
via Blogger https://ift.tt/3dWG2jY
0 notes