22
2/17 How Disk Storage Works • Roll call. • Video: disk storage. • Step-by- step lecture.

2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

Embed Size (px)

Citation preview

Page 1: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

2/17 How Disk Storage Works

• Roll call.

• Video: disk storage.

• Step-by-step lecture.

Page 2: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

1. Formatting a disk: Why bother?

• Formatting provides a “street map” for the data to be laid out on.

• Where’s that data?

Image courtesy of Mapquest.com

Page 3: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

1A. Formatting a disk

• A grid of wedges and tracks, made with magnetic “signposts”is laid out across the disk.

Page 4: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

1B. Formatting a disk: wedges

• Wedges are wedge-shaped areas on a disk.

• Divided radially.

Page 5: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

1C. Formatting a disk: tracks

• Tracks are ring-shaped sections of the disk.

Page 6: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

1D. Formatting a disk

• The read/write heads check these signposts as it reads the disk to know where it is.

Page 7: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

2. Sectors

• The junction of a wedge and a track is called a sector.

• Sectors can be thought of as city blocks: the 3600 block of Lindell Boulevard -- 1 sector, 1 block.

Page 8: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

2A. Sectors make up clusters

• A cluster is two or more sectors.

• A cluster is the smallest unit of storage for the disk.

Page 9: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

2B. How many sectors to a cluster?

• EX: a file needs 8K of space. Each sector is 12K big.

• How much disk space will the file take up?ANS: 24K (2 sectors is the minimum space)

Page 10: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

2C. Operating systems differ

• Different operating systems divide up the disk in different portions.

• Some are more efficient than others.

Page 11: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

3. The FAT and the VFAT

• A directory file -- File Allocation Table is created in sector 0 of the disk.

• DOS: FAT

• Win95: VFAT -- Virtual File Allocation Table

Page 12: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

3A. Differences: FAT and VFATname length bits

read

FAT <=11 char. 16 bits

VFAT <=255 32

VFAT is faster at

accessing data than

FAT.

Page 13: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

4. Writing a file to a disk

• The program is holding the file in the RAM.

• When you click “Save”, it asks the CPU to move the file from RAM to a disk.

RAM

HARD DRIVE

Page 14: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

5. First, list it in the VFAT

• The operating system changes the VFAT to list where the file will be stored in the folders in the directory.

Page 15: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

6. Second, find a spot for the file

• The VFAT also tells the operating system where an available cluster is on the disk.

• The cluster address lists the track and sectors that make up the cluster.

Page 16: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

7. The VFAT to the OS to the BIOS

• The VFAT tells the OS what the address is of the cluster.

• The OS hands off the info to the BIOS.

Page 17: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

8. The BIOS sends the file

• The BIOS grabs the file out of the RAM. It tells the disk controller to save the file, starting at the beginning point of the cluster.”

Page 18: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

9. Oops! The file’s too big

• If the file is bigger than the cluster, the VFAT tells the OS where another available cluster is.

• The BIOS continues sending the file, but now directed to the next cluster.

Page 19: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

9A. Oops! The file’s too big

• The VFAT keeps track of the chain of clusters that the file uses.

Page 20: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

10. File’s done!

• An end of file marker tells the BIOS and VFAT that the transfer is complete.

Page 21: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

11. Update the VFAT

• The file’s record in the VFAT is updated with the various clusters that make up the file.

Page 22: 2/17 How Disk Storage Works Roll call. Video: disk storage. Step-by-step lecture

On 2/19:

• Reading a file from a disk

• How a hard drive works

• 2nd individual assignment discussion