Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
With fstab the patitions are mouted.
I think it is not possible to create a directory below /mnt before the lines in fstab are executed.
You can create that directory manually from command line in run level 3 or 5.
Normally, /mnt is on a permanent filesystem (as part of the root filesystem). Once the subdirectory is created, it will be available on the next boot - thus available before the mount operation gets done.
I thought using rc.local might be a solution using these commands:
mount -t ext4 /dev/sda5 /mnt/tempdir
[user1@localhost mnt]$ file /dev/sda5
/dev/sda5: block special
Then change ownership of rc.local to execute on reboot:
chmod +x /etc/rc.d/rc.local
I have also commented out mount command in /etc/fstab.
But when I reboot I see these in /mnt/tempdir:
[user1@localhost mnt]$ ls tempdir1/ aquota.user lost+found
So it works...... But notice I did not specify quota in rc.local.
So why is aquota.user added auto-magically?
What causes it?
But now I have another problem:
[user1@localhost ~]$ sudo chown user1.user1 /mnt/tempdir1/
[user1@localhost ~]$ ls -al /mnt/tempdir1/
drwxr-xr-x. 3 user1 user1 1024 May 25 11:04 .
drwxr-xr-x. 3 root root 21 May 25 11:00 ..
drwx------. 2 root root 12288 May 25 11:04 lost+found
[user1@localhost ~]$ ls -al /mnt
drwxr-xr-x. 3 root root 21 May 25 11:00 .
dr-xr-xr-x. 17 root root 4096 Apr 15 14:53 ..
drwxr-xr-x. 3 user1 user1 1024 May 25 11:04 tempdir1
[user1@localhost ~]$ sudo quotacheck -u user1 -f /mnt/tempdir1
quotacheck: Cannot stat() given mountpoint user1: No such file or directory
quotacheck: No correct mountpoint specified.
quotacheck: Cannot initialize mountpoint scan.
[user1@localhost tempdir1]$ pwd
[user1@localhost tempdir1]$ sudo quotacheck -u -f /mnt/tempdir1
quotacheck: Mountpoint (or device) /mnt/tempdir1 not found or has no quota enabled.
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.
The directory exists, and mount point exists like so:
[user1@localhost tempdir1]$ mount | grep tempdir1
/dev/sda5 on /mnt/tempdir1 type ext4 (rw,relatime,seclabel,data=ordered)
and I do quotacheck again:
[user1@localhost tempdir1]$ sudo quotacheck -u -f /mnt/tempdir1
quotacheck: Mountpoint (or device) /mnt/tempdir1 not found or has no quota enabled. quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.
quotacheck examines each filesystem, builds a table of current disk usage, and compares this table against that recorded in the disk quota file for the filesystem (this step is ommitted if option -c is specified). If any inconsistencies are detected, both the quota file and the current system copy of the incorrect quotas are updated (the latter only occurs if an active filesystem is checked which is not advised). By default, only user quotas are checked. quotacheck expects each filesystem to be checked to have quota files named [a]quota.user and [a]quota.group located at the root of the associated filesystem. If a file is not present, quotacheck will create it.
quotacheck expects each filesystem to be checked to have quota files named [a]quota.user and [a]quota.group located at the root of the associated filesystem. If a file is not present, quotacheck will create it
But I did not ran quotacheck at the time before I look at /mnt/tempdir1.
I just boot up and look at /mnt.tempdir1,
and aquota.user shows up.
I also deleted tempdir1 before reboot!
Maybe the /dev/sda5 was mounted some time ago, with quotas enabled?
I still do not understand why a simple entry in fstab plus one time a mkdir does not work for you.
It turns out you do not have to create the path and subdirectory needed for a mount point. It is created (by who?) when command in /etc/fstab were executed at boot time.
I unmounted /mnt/tempdir, and deleted all directories in /mnt.
I also commented out everything I did in /etc/rc.local
Then created another partition, /dev/sda8, format it with ext4, and put it in /etc/fstab like so:
/dev/sda5 /mnt/tempdir ext4 defaults 0 0
/dev/sda8 /mnt/temp ext4 default 0 0
Recall that /dev/sda5 is the partition that auto-magically has aquota.user when it is mounted to /mnt/tempdir.
and now I reboot ...there is no aquota.user auto-magically create for /dev/sda8 in /mnt/temp:
[user1@localhost mnt]$ ls -al /mnt/temp
drwxr-xr-x. 3 root root 1024 May 26 13:50 .
drwxr-xr-x. 4 root root 31 May 26 13:53 .. drwx------. 2 root root 12288 May 26 13:50 lost+found
So I suspect there is a command that I may have done previously that creates aquota.user in /mnt/temp as shown here:
[user1@localhost mnt]$ ls -al /mnt/tempdir
drwxr-xr-x. 2 user1 user1 1024 May 25 12:29 .
drwxr-xr-x. 4 root root 31 May 26 13:53 .. -rw-------. 1 root root 6144 May 25 12:34 aquota.user
Question#1: Why is directory "lost+found" not shown in /mnt/tempdir but it is shown in /mnt/temp?
Below shows sda5 and sda8 are type ext4:
[user1@localhost mnt]$ sudo parted -l
[sudo] password for user1:
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 12.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
I thought quota was enable in /mnt/tempdir, but that is not the case:
[user1@localhost mnt]$ quota -u -f /mnt/tempdir
quota: Mountpoint (or device) /mnt/tempdir not found or has no quota enabled.
quota: Not all specified mountpoints are using quota.
[user1@localhost mnt]$ mount | grep temp
/dev/sda8 on /mnt/temp type ext4 (rw,relatime,seclabel,data=ordered)
/dev/sda5 on /mnt/tempdir type ext4 (rw,relatime,seclabel,data=ordered)
Question#2: Recall that there is nothing in /etc/fstab or /etc/rc.local command line that cause the creation of quotas in /mnt/tempdir, so how do I prevent aquota.user from being created in case for /dev/sda5?