How to extend the root partition in Ubuntu 18.04How can I resize an ext root partition at runtime?How to create a separate home partition after installing Ubuntu under single / partitionExpand the size of / partition with unallocated spaceHow to extend my root (/) partition?Gparted - How to move partition to extend the sizeExtend the Linux Native Pratition DiskHow to extend storage space on VPS (LVM) 9GB to 40GBhow to extend my root (/) partitionHow to Extend Ubuntu OS Partition Size from Unallocated Partition?
What's the difference between 记录 and 纪录, both pronounced jìlù, and both meaning "record"?
Finishing pre-cooked prime rib, day-of?
"Is called a sinner" vs "is a sinner"
Missing word! What word am i looking for?
Tactical illusion combat countermeasures (password system)
Why is long term binary put option more expensive than call?
Does the sterile cockpit rule mean flight attendants could not inform the pilots if a passenger is in the lavatory while on final?
smallest number obtainable from 2020
Was I wrong to rebutt unjustified rewiewer comments in the review?
I filled the crucial gap; co-authors did the rest–who should be first author?
Why wasn't Officer Angela Lopez questioned when she killed a suspect?
Why my vim doesn't support hex color code?
As of 2019, why do mountaineering courses still teach how to use a paper map?
Running wider tires in the front
Looking for a Country name
Peptide bond formation in acidic and basic amino acids
The algorithm of the new quantum factoring record 1,099,551,473,989
Java OOP Temperature Converter
Security implication if android app can be installed on emulator
Who is the controller of an Aura when the creature it enchants is stolen?
This new puzzle type needs a name
being overqualified as a barrier for getting a job
Pregnant spouse slipped abortion pills unknowingly. What would the legal ramifications be?
What can Scotland legally do to get independence?
How to extend the root partition in Ubuntu 18.04
How can I resize an ext root partition at runtime?How to create a separate home partition after installing Ubuntu under single / partitionExpand the size of / partition with unallocated spaceHow to extend my root (/) partition?Gparted - How to move partition to extend the sizeExtend the Linux Native Pratition DiskHow to extend storage space on VPS (LVM) 9GB to 40GBhow to extend my root (/) partitionHow to Extend Ubuntu OS Partition Size from Unallocated Partition?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
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.
partitioning nvme
|
show 7 more comments
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.
partitioning nvme
Try usingsudo resize2fs /dev/nvme0n1p1
– Mohammad Kholghi
Oct 2 at 8:07
1
I ran it and I get "The filesystem is already 2096891 (4k) blocks long. Nothing to do!"
– criticalth
Oct 2 at 8:10
First, create a new partition usingsudo fdisk /dev/nvme, then format it and after all, resize your partition usingresize2fs.
– Mohammad Kholghi
Oct 2 at 8:18
1
Please add a screenshot offdisk -l /dev/nvmeto your question.
– Mohammad Kholghi
Oct 2 at 8:24
1
Please do not post screenshots of the terminal. Paste the text directly to your question and apply code formatting.
– Melebius
Oct 2 at 9:22
|
show 7 more comments
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.
partitioning nvme
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.
partitioning nvme
partitioning nvme
edited Oct 2 at 9:32
Melebius
8,0916 gold badges30 silver badges57 bronze badges
8,0916 gold badges30 silver badges57 bronze badges
asked Oct 2 at 7:54
criticalthcriticalth
1535 bronze badges
1535 bronze badges
Try usingsudo resize2fs /dev/nvme0n1p1
– Mohammad Kholghi
Oct 2 at 8:07
1
I ran it and I get "The filesystem is already 2096891 (4k) blocks long. Nothing to do!"
– criticalth
Oct 2 at 8:10
First, create a new partition usingsudo fdisk /dev/nvme, then format it and after all, resize your partition usingresize2fs.
– Mohammad Kholghi
Oct 2 at 8:18
1
Please add a screenshot offdisk -l /dev/nvmeto your question.
– Mohammad Kholghi
Oct 2 at 8:24
1
Please do not post screenshots of the terminal. Paste the text directly to your question and apply code formatting.
– Melebius
Oct 2 at 9:22
|
show 7 more comments
Try usingsudo resize2fs /dev/nvme0n1p1
– Mohammad Kholghi
Oct 2 at 8:07
1
I ran it and I get "The filesystem is already 2096891 (4k) blocks long. Nothing to do!"
– criticalth
Oct 2 at 8:10
First, create a new partition usingsudo fdisk /dev/nvme, then format it and after all, resize your partition usingresize2fs.
– Mohammad Kholghi
Oct 2 at 8:18
1
Please add a screenshot offdisk -l /dev/nvmeto your question.
– Mohammad Kholghi
Oct 2 at 8:24
1
Please do not post screenshots of the terminal. Paste the text directly to your question and apply code formatting.
– Melebius
Oct 2 at 9:22
Try using
sudo resize2fs /dev/nvme0n1p1– Mohammad Kholghi
Oct 2 at 8:07
Try using
sudo resize2fs /dev/nvme0n1p1– Mohammad Kholghi
Oct 2 at 8:07
1
1
I ran it and I get "The filesystem is already 2096891 (4k) blocks long. Nothing to do!"
– criticalth
Oct 2 at 8:10
I ran it and I get "The filesystem is already 2096891 (4k) blocks long. Nothing to do!"
– criticalth
Oct 2 at 8:10
First, create a new partition using
sudo fdisk /dev/nvme, then format it and after all, resize your partition using resize2fs.– Mohammad Kholghi
Oct 2 at 8:18
First, create a new partition using
sudo fdisk /dev/nvme, then format it and after all, resize your partition using resize2fs.– Mohammad Kholghi
Oct 2 at 8:18
1
1
Please add a screenshot of
fdisk -l /dev/nvme to your question.– Mohammad Kholghi
Oct 2 at 8:24
Please add a screenshot of
fdisk -l /dev/nvme to your question.– Mohammad Kholghi
Oct 2 at 8:24
1
1
Please do not post screenshots of the terminal. Paste the text directly to your question and apply code formatting.
– Melebius
Oct 2 at 9:22
Please do not post screenshots of the terminal. Paste the text directly to your question and apply code formatting.
– Melebius
Oct 2 at 9:22
|
show 7 more comments
2 Answers
2
active
oldest
votes
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.
add a comment
|
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:
- Use LVM for your root partition. A logical volume can spread across multiple disks using LVM. However, this would need reinstalling your system or backing it up, preparing LVM volumes and restoring current data.
- Use
nvme1n1for a partition below your root, e.g. a separate/homeor/varpartition.
See also
https://unix.stackexchange.com/a/452135/54675 for NVMe device naming- How to create a separate home partition after installing Ubuntu under single / partition
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1178069%2fhow-to-extend-the-root-partition-in-ubuntu-18-04%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment
|
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.
add a comment
|
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.
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.
edited Oct 2 at 9:47
user3140225
2,7104 gold badges12 silver badges24 bronze badges
2,7104 gold badges12 silver badges24 bronze badges
answered Oct 2 at 9:36
DGenchevDGenchev
363 bronze badges
363 bronze badges
add a comment
|
add a comment
|
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:
- Use LVM for your root partition. A logical volume can spread across multiple disks using LVM. However, this would need reinstalling your system or backing it up, preparing LVM volumes and restoring current data.
- Use
nvme1n1for a partition below your root, e.g. a separate/homeor/varpartition.
See also
https://unix.stackexchange.com/a/452135/54675 for NVMe device naming- How to create a separate home partition after installing Ubuntu under single / partition
add a comment
|
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:
- Use LVM for your root partition. A logical volume can spread across multiple disks using LVM. However, this would need reinstalling your system or backing it up, preparing LVM volumes and restoring current data.
- Use
nvme1n1for a partition below your root, e.g. a separate/homeor/varpartition.
See also
https://unix.stackexchange.com/a/452135/54675 for NVMe device naming- How to create a separate home partition after installing Ubuntu under single / partition
add a comment
|
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:
- Use LVM for your root partition. A logical volume can spread across multiple disks using LVM. However, this would need reinstalling your system or backing it up, preparing LVM volumes and restoring current data.
- Use
nvme1n1for a partition below your root, e.g. a separate/homeor/varpartition.
See also
https://unix.stackexchange.com/a/452135/54675 for NVMe device naming- How to create a separate home partition after installing Ubuntu under single / partition
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:
- Use LVM for your root partition. A logical volume can spread across multiple disks using LVM. However, this would need reinstalling your system or backing it up, preparing LVM volumes and restoring current data.
- Use
nvme1n1for a partition below your root, e.g. a separate/homeor/varpartition.
See also
https://unix.stackexchange.com/a/452135/54675 for NVMe device naming- How to create a separate home partition after installing Ubuntu under single / partition
edited Oct 2 at 9:29
answered Oct 2 at 9:22
MelebiusMelebius
8,0916 gold badges30 silver badges57 bronze badges
8,0916 gold badges30 silver badges57 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1178069%2fhow-to-extend-the-root-partition-in-ubuntu-18-04%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try using
sudo resize2fs /dev/nvme0n1p1– Mohammad Kholghi
Oct 2 at 8:07
1
I ran it and I get "The filesystem is already 2096891 (4k) blocks long. Nothing to do!"
– criticalth
Oct 2 at 8:10
First, create a new partition using
sudo fdisk /dev/nvme, then format it and after all, resize your partition usingresize2fs.– Mohammad Kholghi
Oct 2 at 8:18
1
Please add a screenshot of
fdisk -l /dev/nvmeto your question.– Mohammad Kholghi
Oct 2 at 8:24
1
Please do not post screenshots of the terminal. Paste the text directly to your question and apply code formatting.
– Melebius
Oct 2 at 9:22