TEXT   118

sysadmin.notes

Guest on 6th September 2021 09:31:48 AM

  1. mknod
  2.  
  3. /proc/devices
  4.  
  5. https://github.com/torvalds/linux/tree/master/drivers
  6. https://github.com/torvalds/linux/blob/master/drivers/char/mem.c
  7.    Look for read_null and write_null and null_lseek and null_fops
  8.    similarly for zero_fops and full_fops
  9. and memdev structure (l 806)
  10. https://github.com/torvalds/linux/blob/master/drivers/char/random.c
  11.  
  12.  
  13. cat /dev/zero
  14. echo foo > /dev/zero
  15. echo foo > /dev/null
  16. cat /dev/null
  17. dd if=/dev/zero of=zero.chars bs=1000 count=1
  18.  
  19. ls -l /dev | grep " 1,"
  20.  
  21. /proc/filesystems
  22.      https://github.com/torvalds/linux/tree/master/fs/sysfs
  23.   /sys   --   sysfs
  24.   /proc  --   procfs
  25.     debugfs    -- /sys/kernel/debug
  26.     devpts     -- /dev/pts
  27.  
  28.  
  29. Take a look at /sys -- the sys filesystem
  30.  
  31. In /sys/bus
  32.    WHAT ARE THEY....
  33.    acpi
  34.    i2c
  35.  
  36. What is /sys/fs
  37.   cgroup, ecryptfs, ext4, fuse, pstore
  38. What is /sys/module
  39.  
  40. What is a block vs character device?
  41.     block devices may "cache" blocks in RAM
  42.     take a look at the "top" command
  43. What is a bus?
  44.     What are all the buses (in /sys/bus)
  45.  
  46.  
  47.  
  48. Look at Section 3.4
  49.  
  50. What are the disks on your system
  51.  
  52. Try
  53.    lsscsi
  54.        https://en.wikipedia.org/wiki/SCSI_command
  55.        http://www.seagate.com/staticfiles/support/disc/manuals/Interface%20manuals/100293068c.pdf
  56.    SCSI addresses by LBA not CHS
  57.        https://en.wikipedia.org/wiki/Cylinder-head-sector
  58.  
  59.  
  60. What does this mean?
  61.   /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2:1.0/host12/target12:0:0/12:0:0:0/block/sdc
  62.     What is the northbridge and southbridge
  63.   Intel 4 Series Chipset
  64.     http://www.intel.com/content/www/us/en/processors/xeon/4-chipset-family-datasheet.html
  65.   Intel Z270 chipset
  66.     http://ark.intel.com/products/98089/
  67.     http://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-datasheet-vol-1.html
  68.  
  69. Back to USB -- what does the name mean?
  70.     http://www.makelinux.net/ldd3/chp-13-sect-2
  71.  
  72. mknod create devices
  73.     What can't ordinary users create devices?
  74.     Why aren't devices allowed on USB drives?
  75.  
  76. Section 3.5  -- by the book
  77.     In the old days, you didn't add devices to running systems
  78.  
  79. Take a look at http://www.makelinux.net/ldd3/chp-13-sect-2
  80.  
  81. lsusb
  82.     What is that device?  (vendor + class)
  83.         https://usb-ids.gowdy.us
  84.  
  85. udev -- dynamic device management
  86.     man udev
  87.     /etc/udev/rules.d/
  88.  
  89. udevadm  -- may need a USB device
  90.     udevadm info --query=all --name=/dev/sda
  91.     udevadm monitor
  92.         Look at udev-out.txt
  93.  
  94. Look at Figure 3-2    
  95.  
  96.  
  97.  
  98. Disks, partitions, and file systems -- chapter 4
  99.  
  100. Why partitions?
  101.     http://www.digitalcitizen.life/4-reasons-why-you-should-use-more-one-partition-your-pc
  102. The MBR (Master Book Record) world
  103.     Primary partitions -- up to 4
  104.     Extended partition -- 1 special primary partition
  105.     Logical partitions -- a division of an extended partition
  106. The GPT (Globally unique identifier Partition Table)
  107. Other stuff ---
  108.     lvm -- logical volume manager (in the lab)
  109.         https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)
  110.     hardware RAID -- on the server computers
  111.     software RAID
  112.     ZFS and AdvFS (defunct)
  113.         https://en.wikipedia.org/wiki/ZFS
  114.         https://en.wikipedia.org/wiki/AdvFS
  115.  
  116. Try out the Raspberry Pi
  117.     sudo /sbin/fdisk /dev/mmcblk0
  118.         Do not WRITE!
  119. A partition exercise
  120.     DANGER. DANGER.
  121.     YOU MUST WATCH ME...

Raw Paste


Login or Register to edit or fork this paste. It's free.