Sunday, May 19, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 5221  / 1 Year ago, wed, december 21, 2022, 10:34:42

I have the following situation:



enter image description here



Where I would like to extend the size of nvme0n1 from 8GB to 78 GB using the command line.



Adding also fdisk as requested in comments:



enter image description here



Any help is appreciated.


More From » partitioning

 Answers
0

This looks like an AWS EC2 instance you are adding a new volume to. You started correctly by listing the available devices.



Then, you need to create a file system on the new device (use sudo file -s to check if there is a file system already) with:



sudo mkfs -t ext4 /dev/nvme0n1p1


Then, make a directory on where you want to mount it:



sudo mkdir /mydata


And mount it:



sudo mount /dev/nvme0n1p1 /mydata


Finally, add it to fstab for auto mounting by editing fstab (back it up first) using:



sudo nano /etc/fstab


with the info from:



sudo lsblk -o +UUID


Test by unmounting the file system and then mounting it again with the next commands:



sudo umount /mydata
sudo mount -a


Hope this helps.


[#4836] Friday, December 23, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ngthmated

Total Points: 12
Total Questions: 115
Total Answers: 113

Location: Saint Vincent and the Grenadines
Member since Wed, Apr 21, 2021
3 Years ago
;