Você está na página 1de 4

Quota

[root@sys-6 ~]# fdisk /dev/sda

RH133

Unit 7

The number of cylinders for this disk is set to 19457. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): p Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/sda1 * /dev/sda2 /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8 /dev/sda9 /dev/sda10 Start 1 1306 1306 1959 2612 3265 3297 4381 End 1305 19456 1958 2611 3264 3296 4380 4902 Blocks 10482381 145797907+ 5245191 5245191 5245191 257008+ 8707198+ 4192933+ Id 7 f 7 7 7 83 83 82 System HPFS/NTFS W95 Ext'd (LBA) HPFS/NTFS HPFS/NTFS HPFS/NTFS Linux Linux Linux swap / Solaris

Command (m for help): n Command action l logical (5 or over) p primary partition (1-4) l First cylinder (4903-19456, default 4903): Using default value 4903 Last cylinder or +size or +sizeM or +sizeK (4903-19456, default 19456): +500M Command (m for help): p Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Quota
Device Boot /dev/sda1 * /dev/sda2 /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8 /dev/sda9 /dev/sda10 /dev/sda11 Start 1 1306 1306 1959 2612 3265 3297 4381 4903

RH133
End 1305 19456 1958 2611 3264 3296 4380 4902 4964 Blocks 10482381 145797907+ 5245191 5245191 5245191 257008+ 8707198+ 4192933+ 497983+ Id 7 f 7 7 7 83 83 82 83

Unit 7
System HPFS/NTFS W95 Ext'd (LBA) HPFS/NTFS HPFS/NTFS HPFS/NTFS Linux Linux Linux swap / Solaris Linux

Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. [root@sys-6 ~]# partprobe [root@sys-6 ~]# mkfs /dev/sda11 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 124928 inodes, 497980 blocks 24899 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=67633152 61 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 Writing inode tables: done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 34 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. [root@sys-6 ~]# mkdir /account [root@sys-6 ~]# mount /dev/sda11 /account [root@sys-6 ~]# mount /dev/sda9 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda8 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

Quota

RH133

Unit 7

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) /dev/sda11 on /account type ext2 (rw) [root@sys-6 ~]# vi /etc/fstab LABEL=/ LABEL=/boot1 devpts tmpfs proc sysfs LABEL=SWAP-sda10 /dev/sda11 0 0 / /boot /dev/pts /dev/shm /proc /sys swap /account ext3 ext3 devpts tmpfs proc sysfs swap auto defaults 1 defaults 1 gid=5,mode=620 0 defaults 0 defaults 0 defaults 0 defaults 0 defaults,usrquota 1 2 0 0 0 0 0

[root@sys-6 ~]# umount /account [root@sys-6 ~]# mount -a [root@sys-6 ~]# mount /dev/sda9 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda8 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) /dev/sda11 on /account type ext2 (rw,usrquota) [root@sys-6 ~]# quotacheck /account [root@sys-6 ~]# quotaon /account [root@sys-6 ~]# adduser p1 [root@sys-6 ~]# passwd -d p1 Removing password for user p1. passwd: Success [root@sys-6 ~]# edquota -u p1 Disk quotas for user p1 (uid 504): Filesystem blocks soft /dev/sda11 99 98 or [root@sys-6 ~]#

hard 100

inodes 2

soft 0

hard 0

setquota -u p1 512 1024 0 0 /account

[root@sys-6 ~]# chmod 777 /account [root@sys-6 ~]# su p1 [p1@sys-6 root]$ cd /account [p1@sys-6 account]$ dd if=/dev/zero of=file1 bs=10K count=100 [root@sys-6 account]# ls -l total 119 -rw------- 1 root root 7168 Jan -rw-rw-r-- 1 p1 p1 98304 Jan

4 15:17 aquota.user 4 15:19 file1

Quota

RH133
4 15:12 lost+found

Unit 7

drwx------ 2 root root 12288 Jan

[p1@sys-6 account]$ dd if=/dev/zero of=file2 bs=200K count=100 sda11: warning, user block quota exceeded. sda11: write failed, user block limit reached. dd: writing `file2': Disk quota exceeded 1+0 records in 0+0 records out 0 bytes (0 B) copied, 0.000390645 seconds, 0.0 kB/s

Você também pode gostar