Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet156/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   152   153   154   155   156   157   158   159   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

dir
: device is busy.
The value /
dir
is the mount point you were attempting to unmount (e.g., /home).
You are unable to unmount 
busy
file systems. A busy file system does not mean that it is 
being used exactly at that moment but instead that its status is currently 
open
. For instance, 
if you have logged in through the GUI as a normal user and then used su to change to root, 
you would be unable to umount /home. This is because at least one user is logged in and so 
/home has a status of “busy.” Even 
umount –f
(force) will not work on a busy partition.
In order to unmount either /home or /var, you would have to log in through the text-
based interface and log in as root. You could more easily unmount a remote file system 
(e.g., /home/coolstuff from above) or /cdrom or one of the file systems that may not be in 
use such as /opt or /usr/bin.
10.4.7 Establishing Quotas on a File System
A disk quota limits the amount of space available to a user or a group. You establish quotas 
on a per-partition basis. The only partition that makes any sense to establish quotas on is 
/home as we would only want to place quotas on the user’s space. Here, we look at steps to 
establish disk quotas.
The first step is to modify the partition’s options. The best way to do this is to edit the 
/etc/fstab file. We want to add the option 
usrquota
to any other options listed. Most 
likely, the only option is defaults, so our entry will now appear as 
defaults,usrquota

We could use 
grpquota
in addition to or in place of usrquota if we wanted to establish 
quotas on groups owning files. With this modification made, before we can attempt to 
place quotas on the users (or groups), we would have to remount the /home partition. We 
could unmount and then mount the partition although we could more easily issue the 
command 
mount –o remount /home
. Here, -o indicates an option to the mount instruc-
tion. Usually, these options are placed on the partition (e.g., sync, ro, or rw) but here, the 
option indicates how to mount the partition.
In order to place quotas on users (or groups), we must create a quota database, which we 
accomplish by running 
quotacheck
. We supply the options -c to create the database file 
and -u (or -g) to indicate that quotas are to be established on users (groups). The -u option 
is assigned by default, so it can be omitted. The quotacheck program places the database 
file, 
aquota.user
, at the root level of the given file system; in our case, it creates /
home/
aquota.user
. Note that this is not a text-based database file and so cannot be read or 
written to through a text editor.
In order to create the database, quotacheck performs a scan of the file system in ques-
tion. During this scan, any writes performed to the file system could cause corruption of 


418

Linux with Operating System Concepts
the file system and so it is best to run this program with the given file system unmounted. 
Otherwise, quotacheck will attempt to remount the file system upon completion of the 
scan. There are several things you could do in order to run quotacheck successfully. You 
could run quotacheck during system initialization before the file system has been mounted. 
You could use 
telinit 1
to change run levels, unmount the file system, run the pro-
gram, and then remount the file system. Or, you could issue the -m option. If you do none 
of these, quotacheck will yield an error as it is unable to remount the file system. Our com-
mand becomes 
quotacheck –cmu
/home
.
At this point, you can place quotas on individual users through the command 
edquota

The only required parameter is the username (groupname) of the user you wish to place 
(or alter) a quota on. The username (groupname) can be either a name or a number (UID/
GID). The edquota command drops you into a vi session with the user’s quota information 
displayed. You can now make changes, save, and exit vi. You might find an entry such as 
the following:
Disk quotas for user foxr (uid 500):
Filesystem 
blocks soft hard inodes soft hard
/dev/sda5 
1538 0 0 91 0 0
Soft and hard refer to 

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   152   153   154   155   156   157   158   159   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish