Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 1.93 KB

File metadata and controls

82 lines (56 loc) · 1.93 KB

Disk Management

Partitioning the disk

  1. use fdisk to list the disks
sudo fdisk -l
  1. Use the below fdisk to create one more of Linux LVM partition and follow the instructions (chose 8e for Linux LVM Partition)
sudo fdisk /dev/sdx

Note: sdx is the name of the drive that you would like to partition. Now use the option o to create a new DOS Partition table

once the partition table is created. use the option n to create a new paritiion and follow the on-screen instructions

Note: The size can be specified at the option Last Sector . Ente +{n}G for the partiotion to be of nGB Example: If you have a disk of 100 GB you can chosoe the size to be +100G for a single partition (If you want to create multiple partitions, you can use +30G or +50G or whaterver size (<100G>) you require.

Then finally enter w to save the above changes

Now when your run sudo fdisk -l youd'd see partitions like /dev/sdx1

  1. Now run the below command to format the partition sudo mkfs -t ext4 /dev/sdx1
  2. Now the file can be mounted to any directory
  • Create a new directory
sudo mkdir /mnt/drive
  • mount the new volume to the directory using the below command
sudo mount /dev/sdx1 /mnt/drive

Note: This is only an one time mount. Will not persist after restart.

  1. For persistent mount the entry needs to be added to /etc/fstab
  • run the below command to find the UUID of the newly created partition
sudo blkid

edit /etc/fstab and add the below line.

bashUUID=<UID-of-new-partition-as-per-blkid>  /mnt/drive   ext4 defaults,nofail   1   2
  1. Reboot the system
sudo reboot
  1. Now you should see the drive in /mnt/drive directory

  2. To get the write permissions follow the below steps

  • Change Group ownership to adm group
sudo chgrp adm /mnt/data/
  • Give write permissions to the group
sudo chmod -R g+w /mnt/data/