Ticker

6/recent/ticker-posts

Ad Code

How to add new partition in Linux terminal


 Disk partition


Get the disk details by using below command

# sudo fdisk -l


In which disk you want to create new partition 


# sudo fdisk /dev/sda


Welcome to fdisk (util-linux 2.30.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.


Type n for new partition

Command (m for help): n


Partition number (2-127, default 2):


w to write the partition



change the new partition to ext4 

# sudo mkfs.ext4 /dev/sda2  (new partition number)


# sudo mkdir /media/example


# sudo mount /dev/sda2 /media/example


# sudo vim /etc/fstab




/dev/sda2      /media/Disk1    ext4    defaults        0       0


or


# sudo blkid


copy uuid of sda2 patition


# sudo vim /etc/fstab


UUID=cfb2e895-ecec-41c5-afc2-40ffe2e4384a /media/example ext4    defaults   0  0



Post a Comment

0 Comments