I have the following situation:
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:
Any help is appreciated.
I have the following situation:
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:
Any help is appreciated.
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.
Unfortunately, you cannot extend your root partition since it’s filling all of the available space on the device nvme0n1
. If you want to utilize the space of the device nvme1n1
, you can:
nvme1n1
for a partition below your root, e.g. a separate /home
or /var
partition.
sudo resize2fs /dev/nvme0n1p1
– Mohammad Kholghi Oct 02 '19 at 08:07sudo fdisk /dev/nvme
, then format it and after all, resize your partition usingresize2fs
. – Mohammad Kholghi Oct 02 '19 at 08:18fdisk -l /dev/nvme
to your question. – Mohammad Kholghi Oct 02 '19 at 08:24fdisk /dev/sda1
, butfdisk /dev/sda
. So you should usefdisk /dev/nvme
. To find the correct device, dols /dev/nvme*
. I repeat: don't callfdisk
for a partition, but call it with the whole device. – Mohammad Kholghi Oct 02 '19 at 08:34Gparted
. I did the same some minutes age. – Mohammad Kholghi Oct 02 '19 at 08:39partprobe
toinform the OS of partition table changes
, according to last line offdisk
output orman partprobe
. Or, at last, after a normal restart everything will be fine automatically. – Mohammad Kholghi Oct 02 '19 at 09:10