1 / 37

Lecture 11: Sys Admin-A

Lecture 11: Sys Admin-A. Mounting Fragmentation. Mounting. I have files on a thumb drive (They’re incredibly important) I plug it in to my computer It’s booted into the finest Linux distro How do I actually get to my files?

nile
Download Presentation

Lecture 11: Sys Admin-A

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 11: Sys Admin-A • Mounting • Fragmentation

  2. Mounting • I have files on a thumb drive • (They’re incredibly important) • I plug it in to my computer • It’s booted into the finest Linux distro • How do I actually get to my files? • Assume my finest Linux distro isn’t set to auto-mount my thumb drive

  3. Mounting • We need a mount point

  4. Mounting • We need a mount point • mkdir -p /media/meh • Now we need to mount it

  5. Mounting • We need a mount point • mkdir -p /media/meh • Now we need to mount it • mount /dev/sdb1 /media/meh

  6. Mounting • We need a mount point • mkdir -p /media/meh • Now we need to mount it • mount /dev/sdb1 /media/meh • All done? • What about filesystem type?

  7. Mounting • We need a mount point • mkdir -p /media/meh • Now we need to mount it • mount /dev/sdb1 /media/meh • All done? • What about filesystem type? • Other mount options?

  8. Mounting • My thumb drive contains slides • I don’t want to do this every MFW • I want to tell Linux to mount it every time • How do I do that?

  9. Mounting • My thumb drive contains slides • I don’t want to do this every MFW • I want to tell Linux to mount it every time • How do I do that? • /etc/fstab!

  10. Mounting

  11. Mounting • Device by… • …name • …ID

  12. Mounting • Mount points

  13. Mounting • Filesystem type • ‘proc’ is special • ‘ntfs-3g’ is essentially just ‘ntfs’

  14. Mounting • Options • There’s a bunch of them

  15. Mounting • auto/noauto • Mount device at bootupvs don’t • exec/noexec • Allow execution of binaries/scripts from this partition vs don’t • ro/rw • Read only vs read/write • sync/async • Write files immediatelyvs allowing them to be written later • user/users/nouser • Allow anyone (those listed) to mount device vs only letting root mount it

  16. Mounting • Lots more options! • suid/nosuid • attime • gid • umask • size • credentials • mode • dev/nodev

  17. Mounting • defaults • rw (read/write) • suid (allow us to set user/group ID bits) • dev (treat data as block device) • exec • auto • nouser • async

  18. Mounting • Dump • 0  Do not backup filesystem • 1  Backup the filesystem • It’s almost always 0

  19. Mounting • fsck • “filesystem check” • Order of filesystems to check • 0 means to ignore the filesystem

  20. Mounting • Mounting in Windows is a little more hands-off • Mount point is set • For us, we just see it in “My Computer” • What happens when my device doesn’t show up there?

  21. Mounting • Mounting in Windows is a little more hands-off • Mount point is set • For us, we just see it in “My Computer” • What happens when my device doesn’t show up there? • Look at Disk Management!

  22. Mounting

  23. Mounting • Many things are either familiar or obvious • Note that my linux partitions don’t have… • …a filesystem type (fat32, ntfs, ext3,…) • “Type” in Disk Management means something else • …drive letter

  24. Fragmentation Dear Students, Please wait while the bearded man draws you pretty pictures on the board. They will help you. Sincererly, -RVH

  25. Fragmentation • Recall our partition has: • inodes at the start • “data” blocks afterwards • Let’s assume that we have no data on the partition • Maybe it’s a thumb drive we just formatted

  26. Fragmentation • When I create a file, I get a single inode and no data block. • When I first write some content to the file, I get a block of storage • Assume just one for now

  27. Fragmentation • I then create several more files • They all need a block themselves • I finally go back to my original file and make it larger • E.g., I finished out my slides for a certain Wednesday lecture • Where did I just get a block at?

  28. Fragmentation • I then create several more files • They all need a block themselves • I finally go back to my original file and make it larger • E.g., I finished out my slides for a certain Wednesday lecture • Where did I just get a block at? • Why isn’t it next to the other one?

  29. Fragmentation • My file is now scattered all over the partition • This is external fragmentation • How can I fix this? • I need to rearrange my files • Have to be careful in how I do this • We have tools • “Defragmenters”

  30. Fragmentation • “Defragmenters” usually only do external fragmentation. • So what’s internal fragmentation?

  31. Fragmentation • “Defragmenters” usually only do external fragmentation. • So what’s internal fragmentation? • I must reserve at least one block • If block is 128KB, then I just got 128KB • Assume my file is 4KB • My file wastes space!

  32. Fragmentation • How do we fix this?

  33. Fragmentation • How do we fix this? • Leave it alone? • Put multiple files into one block? • Reduce block size?

  34. Fragmentation • How do we fix this? • Leave it alone? • Easy to do • Wastes space • Put multiple files into one block? • Reduce block size?

  35. Fragmentation • How do we fix this? • Leave it alone? • Easy to do • Wastes space • Put multiple files into one block? • Saves space • More overhead • Reduce block size?

  36. Fragmentation • How do we fix this? • Leave it alone? • Easy to do • Wastes space • Put multiple files into one block? • Saves space • More overhead • Reduce block size? • Superblock settings were chosen for performance. Usually undesirable to change this

  37. Fragmentation • How do we fix this? • Leave it alone? • Easy to do • Wastes space • Put multiple files into one block? • Saves space • More overhead • Reduce block size? • Superblock settings were chosen for performance. Usually undesirable to change this

More Related