This repository provides a comprehensive guide on managing disk partitions, creating file systems, and configuring logical volumes in Linux. It covers essential topics such as MBR and GPT partitioning, file system mounting, and advanced techniques like LVM (Logical Volume Management) and swap space creation.
2.File System Creation and Mounting
- Partition Types:
- MBR (Master Boot Record): Supports up to 4 primary partitions.
- GPT (GUID Partition Table): Allows up to 128 partitions and supports larger disk sizes.
- Primary Partition: Contains bootable and critical system files.
- Extended Partition: Used to create additional logical partitions.
1.Go to setting
- click on Settings and then click Add.
3.Choose the Disk Type
4.Create a New Virtual Disk.
5.Specify the Disk Size
6.Finish Adding the Disk
7.Verify the New Hard Disk
8.Add Additional Disks (Optional)
Commands:
Lists all block devices
Lists partition details
Steps:
Press n for a new partition.
Choose p for Primary or e for Extended.
Specify Partition Number (default: 1).
Define First and Last Sector (e.g., +8G for size).
Save with w.
Verify the changes
View Partitions: p
List Types: l
Change Type: t (e.g., switch 83 to 82 for swap)
Delete Partition: d
Show Free Space: F
Detect Errors: v
Quit Without Saving: q
Steps:
Press n for a new partition.
Enter Partition Number (default: 1).
Define First and Last Sectors (e.g., +15G for size).
Enter Hex Code for Type (e.g., 8300 for Linux filesystem).
Save with w.
Verify the changes.
It is temporary; it will be gone after a restart.
- Check Mounted Disks:
- View UUID:
- Add to /etc/fstab for persistent mounting:
vim /etc/fstab
- Apply changes:
- Unmount and Clean Up All:
- Enterprise storage: XFS, ZFS, or Btrfs.
- Desktop usage: ext4.
- Compatibility: FAT32 or exFAT.
- Snapshots and advanced features: Btrfs or ZFS.
n # Create new partition
p # Print partition
w # Write and exit
Repeat for /dev/sdb, /dev/sdc.
Change Type: t
Hex Code: 8200 (for swap)
w # Save