Академический Документы
Профессиональный Документы
Культура Документы
---------------------------------
OVERVIEW:
There are many myths and theories on how UFS deals withJfiles and fragments.
1) # exec ksh
# newfs -i 1024 /dev/rdsk/c0t1d0s0
# mount /dev/rdsk/c0t1d0s0 /mnt
# dd if=/dev/zero of=/2kfile bs=2k count=1
# x=0
# while :
> do cp /2kfile /mnt/file.$x
> let x=x+1
> done
In the following example, we see that the UFS has plenty of free space.
Currently, each data block has 6 out of 8k occupying the data block.
We will see that the shuffling DOES NOT happen when we try to create
a file larger than 2k.
1) # df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 96455 52430 34380 61% /
/dev/dsk/c0t0d0s6 8052181 703366 7268294 9% /usr
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
swap 520496 0 520496 0% /var/run
swap 521296 800 520496 1% /tmp
/dev/dsk/c0t0d0s5 288391 30168 229384 12% /opt
/dev/dsk/c0t0d0s7 96455 68844 17966 80% /export/home
/dev/dsk/c0t1d0s0 360775 359870 905 100% /mnt
2) # cd /mnt
# mkfile 2k file.a
#! The UFS had no problem creating a 2k file. The file was written to the remaining
#! 2k of the logical data block that was 6/8 full.
3) # mkfile 4k file.b
Could not set length of file.b: No space left on device
2) # mkfile 2k file.c
# cat /2kfile >> /mnt/file.c
cat: write error: No space left on device
1) # rm file.[0-9][0-9]
2) # mkfile 2k /mnt/file.d
# fsdb /dev/rdsk/c0t1d0s0
*SNIP OUTPUT*
*SNIP OUTPUT*
4) # fsdb /dev/rdsk/c0t1d0s0
*SNIP OUTPUT*
*SNIP OUTPUT*
SECTION VI - Notes
------------------