TEXT 32
System Admin Class 3 Guest on 22nd October 2022 11:41:07 AM
  1. Two type of partitions in Linux
  2. Total only four partitions can be created
  3. Primary
  4. Extended (It can then create logical paritions)
  5. so 3 Primary partition and an Extended (This can have multiple logical partitions)
  6.  
  7. It is also only limited to one drive
  8.  
  9. The way better is to use LVM
  10. Can add many disk drives and combine into one group, it is flexible.
  11. Though the static primary partition is always required as BIOS can read primary disk, and it cannot directly read LVM.
  12. When Kernel mounts root, it can then read LVM
  13.  
  14. LVM can be extended without data loss and without any downtime.
  15.  
  16. Partioning Utilities:
  17. Parted
  18. Gdisk
  19. Partx
  20.  
  21. fdisk /dev/sdb
  22. press n for new partition
  23. select primary or extended
  24. First sector - keep it default
  25. Last sector - this is where space is allocated so +5G can be written for 5 GB parition size
  26.  
  27. Press w to save the partition
  28.  
  29. After partition, it is required to format the disk.
  30.  
  31.  
  32. mkfs.ext4 /dev/sdb1
  33. mkfs.ext4 /dev/sdb2
  34.  
  35. mkdir /disk1
  36. mount /dev/sdb1 /disk1
  37.  
  38. to unmount the disk: umount /dev/sdb1
  39.  
  40. can be also mounted within the directory, for example, /disk1/disk2 - the disk2 can be mounted inside the folder.
  41.  
  42. oom = out of memory
  43. this kills the process when the process needs more RAM and its not enough to prevent system from getting crashed
  44.  
  45. buffer and cache memory can be used when free is utilized
  46.  
  47. to make swap: mkswap /dev/sdb1
  48. to turn on swap: swapon /dev/sdb1
  49.  
  50. it is not required to format and mount the swap
  51.  
  52. fstab is required so that on system startup, disks can be be mounted. File: /etc/fstab
  53. For example:
  54. /dev/sdb1               /disk1          ext4            defaults                0 0

Coding Base is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

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