- Two type of partitions in Linux
- Total only four partitions can be created
- Primary
- Extended (It can then create logical paritions)
- so 3 Primary partition and an Extended (This can have multiple logical partitions)
- It is also only limited to one drive
- The way better is to use LVM
- Can add many disk drives and combine into one group, it is flexible.
- Though the static primary partition is always required as BIOS can read primary disk, and it cannot directly read LVM.
- When Kernel mounts root, it can then read LVM
- LVM can be extended without data loss and without any downtime.
- Partioning Utilities:
- Parted
- Gdisk
- Partx
- fdisk /dev/sdb
- press n for new partition
- select primary or extended
- First sector - keep it default
- Last sector - this is where space is allocated so +5G can be written for 5 GB parition size
- Press w to save the partition
- After partition, it is required to format the disk.
- mkfs.ext4 /dev/sdb1
- mkfs.ext4 /dev/sdb2
- mkdir /disk1
- mount /dev/sdb1 /disk1
- to unmount the disk: umount /dev/sdb1
- can be also mounted within the directory, for example, /disk1/disk2 - the disk2 can be mounted inside the folder.
- oom = out of memory
- this kills the process when the process needs more RAM and its not enough to prevent system from getting crashed
- buffer and cache memory can be used when free is utilized
- to make swap: mkswap /dev/sdb1
- to turn on swap: swapon /dev/sdb1
- it is not required to format and mount the swap
- fstab is required so that on system startup, disks can be be mounted. File: /etc/fstab
- For example:
- /dev/sdb1 /disk1 ext4 defaults 0 0
Recent Pastes