System Administration Instructions
These instructions are quick reference guides for various system administration tasks that are frequently used within the lab.
Quota Administration
You can set quotas on disk space (blocks) or number of files (inodes). Normally, the quotas should be set based on disk space. If there is no quota set, the user has no restrictions on that filesystem. There are two types of quota limits:
- Hard quota - The absolute maximum size of a user's files on the partition.
- Soft quota - The user can go over the soft quota for a number of days, the length of which is set by the "grace period."
- Grace period - The number of days a user is allowed to be over his soft quota before he can no longer write
If you do not want to deal with soft quotas, set the hard/soft quota to the same number.
Administrative Commands
These commands must be run from the machine with the quota enabled filesystem, i.e., carna).
- List all quotas
# /usr/sbin/repquota -a - List a user's quota
# /usr/bin/quota <username> - Change quota
# /usr/sbin/setquota doebler 500000 500000 0 0 /dev/md0
(Set the hard/soft size quota to 500MB. No file quota) - Change quota interactively
# /usr/sbin/edquota doebler
(Edit the quota for the user in an editor. Set the EDITOR variable
if you would rather not use vi)
User Commands
The user can just type "quota" to check his filesystem quota. The filesystem had to be mounted to check the quota. The user will get a "Disk quota exceeded" message if they hit their hard
quota.
Example command: tiree.ius> quota
Disk quotas for user doebler (uid 7102):
Filesystem blocks quota limit grace files quota limit grace
hershiser:/vmr54 6012 500000 500000 1 0 0
How to Repartition a Disk
Use fdisk (/sbin/fdisk).
- Delete old partitions (d command)
- Add new partitions (n command)
- Print using p command to make sure it is correct
- Finally, write using the w command
Note, there are some intricacies about choosing primary vs. logical partitions.
How to Format a Disk
Be sure exiting partitions are unmounted:
> umount /dev/hde5
If it says it is busy, use fuser to determine which processes are using that partition:
> fuser /usr0
Setup partitions as above.
Create the file system using mkfs
example: > mkfs /dev/hde5
Convert to ext3 using tune2fs
example: > tune2fs -j /dev/hde5
Create a directory to serve as the mount point (e.g. /usr5)
Edit the file system table (/etc/fstab) and add the entries.
Use the mount command to mount the new partitions:
> mount -a
How to Allow Root to Copy Files from One Computer to Another
Edit the /etc/exports file and add a line like this
(this is hershiser's exports file)
/usrb @IUS(rw) canna.ius.cs.cmu.edu(rw,no_root_squash)
This allows the /usrb directory on hershiser to be accessed by root on canna.
You may need to re-export using the exportfs command:
/usr/sbin/exportfs -a
Also, you may need to unmount the directory in order for it to be re-mounted with the new privileges.
Booting from Floppy
Use tom's rootboot, which is located in the box of floppies on the computer equipment bookshelf. Warning, sometimes the floppy won't boot due to infrequent use of the floppy drives. Try wiggling the floppy or trying to boot multiple times.
Disk Speed Testing
Use the hdparm command.
> hdparm -t -T <device>
Example:
> hdparm -t -T /dev/hda
Timing for buffer-cache reads typically: 256MB/sec
Timing for buffered disk reads typically: 40MB/sec
Backups
To determine which partition is being backed up, use the program bustatus. You have to be root to run it. If you don't have root access, you can look at the file /usr/adm/fac/lib/tibs/teralog.txt, which is in a hard to read format but has the same information.
Samba Server
- The server is running as a process (or processes) called smbd on the file server carna.
- To restart the server, use the command "/etc/rc.d/init.d/smb restart". This command must be run as root. Alternatate options to smb are stop and start.
- New partitions have to be added as symlinks in /home/samba for them
to be accessible. - To add a new user, edit the smb.conf file on carna (/etc/samba/smb.conf). Add the username to the list of valid users in the [homes] and [samba] sections.
Temp Space Watchdog
A script titled tempwatchdog.sh is scheduled to run from hershiser on the first day of each month to monitor usage of temp space on all the machines in the lab. It works by calling the monitor.pl script to
check the last access time of top level directories in each temp-space partition. The script then sends an email to the owner of the directory if the files in that directory have not been accessed in 60
days.
To add or delete temp partitions to be considered, simply edit the arguments listed in the tempwatchdog.sh script located in /etc/cron.monthly on hershiser.