Tag Archive: fstab


Disk Quota

Create a partition and format.

Mount with /home directory.

Permanent mount in —  /etc/fstab
/dev/sda10   /home   ext3   defaults,usrquota    0   0

#  mount  -o  remount  /home

#  quotacheck  -c  -u  /home {a file “aquota.user” is created in /home directory}.

#  quotaon  -av

#  edquota  -u  [username] {edit quota for a user}.

set the soft OR hard values :

Filesystem    blocks  soft  hard  inodes  soft  hard

/dev/sda10      5         0      0         5         0        0

No. of files = soft – inode / hard – inode / soft – blocks / hard – blocks

Eg. 10 – 5 = 5 OR 20 – 5 = 15

Soft – Gives only warning , one time.

Hard – Deletes files after 7 days.

Hard – Prevents from making files or writing blocks.

Partitioning and Mounting in Linux

To display the list of all partitions :

#  fdisk   -l

For first time partition :

1. #  fdisk  /dev/sda
2. Press ‘n’                                                 { To choose between extended and primary partition}.
3. Press ‘e’                                                 {For extended partition}.
4. Skip the first cylinder
5. +100M                                                  {Enter size}.
6. Press ‘w’                                                {To write partition to disk}.
7. #  partprobe   /dev/sda OR  #  partprobe {To update kernel online}.

For Linux partitions repeat the above process, but eliminate the process number 3 .

Formatting :

For ext2 format :

#  mke2fs  /dev/sda9

For ext3 format :

#  mke2fs  -j  /dev/sda9

To convert ext2 to ext3 format :

#  tune2fs  -f  /dev/sda10

For ext4 format :

# mke2fs -t ext4 /dev/sda9

Mounting :

#  mount [sourcepoint]  [mount point]

Eg. #  mount  /dev/dvd  /media/pd {For mounting dvd}.
#  mount  /dev/cdrom  /media/pd {For mounting cd}.
#  mount  /dev/sdb1  /media/pd {For mounting pen drive}.

Permanent Mounting :

Edit in ‘fstab’ file :

#  vi  /etc/fstab

/dev/sda9        /test       ext3       defaults      0      0

{mount point, filesystem and attributes can be changed as per the needs}