Resize partition without using LVM

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have Ubuntu 16.04 installed on remote server and I have requested another 20GB for my /dev/vda2 partition (now its 20GB), so the total size would be 40GB. Since vda2 is full of very valuable data (disk usage is 100%), I want to extend it.
Now, I have searched for ways to do it but I found out my LVM is not configured, or at least it looks like it, because when I run for example vgdisplay nothing happens. Then I tried vgscan and it says Reading volume groups from cache. but that's it.
I have tried to follow this tutorial https://www.linuxtechi.com/extend-lvm-partitions/ but since I can't run
# vgdisplay < Volume-Group-Name>
because I don't know my volume-group-name, I am stuck.
What can I do ? I am looking for the safest way and also easiest since I have 2 databases running there, I backed up all my data from them but I really don't want to set it all up once again...
Just for info, when I run fdisk -l I get this:

Edit:
this is what I got regarding to answer below:



label: gpt
label-id: 88501878-0C4F-486D-B09A-1AD0A6C81982
device: /dev/vda
unit: sectors
first-lba: 34
last-lba: 41943006
/dev/vda1 : start= 2048, size= 2048, type=21686148-6449-6E6F-744E-656564454649, uuid=6FA9DDEF-760F-4276-9DF0-B8A62F9C51BD
/dev/vda2 : start= 4096, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=E0912389-7C07-41F7-A21E-B8B131F2C491
ubuntu lvm disk-usage resize2fs
add a comment |
up vote
0
down vote
favorite
I have Ubuntu 16.04 installed on remote server and I have requested another 20GB for my /dev/vda2 partition (now its 20GB), so the total size would be 40GB. Since vda2 is full of very valuable data (disk usage is 100%), I want to extend it.
Now, I have searched for ways to do it but I found out my LVM is not configured, or at least it looks like it, because when I run for example vgdisplay nothing happens. Then I tried vgscan and it says Reading volume groups from cache. but that's it.
I have tried to follow this tutorial https://www.linuxtechi.com/extend-lvm-partitions/ but since I can't run
# vgdisplay < Volume-Group-Name>
because I don't know my volume-group-name, I am stuck.
What can I do ? I am looking for the safest way and also easiest since I have 2 databases running there, I backed up all my data from them but I really don't want to set it all up once again...
Just for info, when I run fdisk -l I get this:

Edit:
this is what I got regarding to answer below:



label: gpt
label-id: 88501878-0C4F-486D-B09A-1AD0A6C81982
device: /dev/vda
unit: sectors
first-lba: 34
last-lba: 41943006
/dev/vda1 : start= 2048, size= 2048, type=21686148-6449-6E6F-744E-656564454649, uuid=6FA9DDEF-760F-4276-9DF0-B8A62F9C51BD
/dev/vda2 : start= 4096, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=E0912389-7C07-41F7-A21E-B8B131F2C491
ubuntu lvm disk-usage resize2fs
Well yes, thats what I have found out too. I had no idea when installing system, that I need LVM ...didn't even know what its for. But now I have no idea what to do and I need it bad.
– Ady96
Nov 26 at 18:27
Remember to check whether your VPS provider supports starting virtual machines from LVM.
– Henrik
Nov 26 at 18:43
there is no way I can reinstall system, copy data, etc...I am looking for a solution as it is now, there must be some way
– Ady96
Nov 26 at 18:48
If your VPS provider alllows to grow virtual disks, it can be done. but we cannot guess it.
– Rui F Ribeiro
Nov 26 at 18:51
Are... you sure this is LVM? This doesn't look like an LVM setup...
– Thomas Ward
Nov 26 at 18:57
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have Ubuntu 16.04 installed on remote server and I have requested another 20GB for my /dev/vda2 partition (now its 20GB), so the total size would be 40GB. Since vda2 is full of very valuable data (disk usage is 100%), I want to extend it.
Now, I have searched for ways to do it but I found out my LVM is not configured, or at least it looks like it, because when I run for example vgdisplay nothing happens. Then I tried vgscan and it says Reading volume groups from cache. but that's it.
I have tried to follow this tutorial https://www.linuxtechi.com/extend-lvm-partitions/ but since I can't run
# vgdisplay < Volume-Group-Name>
because I don't know my volume-group-name, I am stuck.
What can I do ? I am looking for the safest way and also easiest since I have 2 databases running there, I backed up all my data from them but I really don't want to set it all up once again...
Just for info, when I run fdisk -l I get this:

Edit:
this is what I got regarding to answer below:



label: gpt
label-id: 88501878-0C4F-486D-B09A-1AD0A6C81982
device: /dev/vda
unit: sectors
first-lba: 34
last-lba: 41943006
/dev/vda1 : start= 2048, size= 2048, type=21686148-6449-6E6F-744E-656564454649, uuid=6FA9DDEF-760F-4276-9DF0-B8A62F9C51BD
/dev/vda2 : start= 4096, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=E0912389-7C07-41F7-A21E-B8B131F2C491
ubuntu lvm disk-usage resize2fs
I have Ubuntu 16.04 installed on remote server and I have requested another 20GB for my /dev/vda2 partition (now its 20GB), so the total size would be 40GB. Since vda2 is full of very valuable data (disk usage is 100%), I want to extend it.
Now, I have searched for ways to do it but I found out my LVM is not configured, or at least it looks like it, because when I run for example vgdisplay nothing happens. Then I tried vgscan and it says Reading volume groups from cache. but that's it.
I have tried to follow this tutorial https://www.linuxtechi.com/extend-lvm-partitions/ but since I can't run
# vgdisplay < Volume-Group-Name>
because I don't know my volume-group-name, I am stuck.
What can I do ? I am looking for the safest way and also easiest since I have 2 databases running there, I backed up all my data from them but I really don't want to set it all up once again...
Just for info, when I run fdisk -l I get this:

Edit:
this is what I got regarding to answer below:



label: gpt
label-id: 88501878-0C4F-486D-B09A-1AD0A6C81982
device: /dev/vda
unit: sectors
first-lba: 34
last-lba: 41943006
/dev/vda1 : start= 2048, size= 2048, type=21686148-6449-6E6F-744E-656564454649, uuid=6FA9DDEF-760F-4276-9DF0-B8A62F9C51BD
/dev/vda2 : start= 4096, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=E0912389-7C07-41F7-A21E-B8B131F2C491
ubuntu lvm disk-usage resize2fs
ubuntu lvm disk-usage resize2fs
edited Nov 26 at 20:58
asked Nov 26 at 18:14
Ady96
1085
1085
Well yes, thats what I have found out too. I had no idea when installing system, that I need LVM ...didn't even know what its for. But now I have no idea what to do and I need it bad.
– Ady96
Nov 26 at 18:27
Remember to check whether your VPS provider supports starting virtual machines from LVM.
– Henrik
Nov 26 at 18:43
there is no way I can reinstall system, copy data, etc...I am looking for a solution as it is now, there must be some way
– Ady96
Nov 26 at 18:48
If your VPS provider alllows to grow virtual disks, it can be done. but we cannot guess it.
– Rui F Ribeiro
Nov 26 at 18:51
Are... you sure this is LVM? This doesn't look like an LVM setup...
– Thomas Ward
Nov 26 at 18:57
add a comment |
Well yes, thats what I have found out too. I had no idea when installing system, that I need LVM ...didn't even know what its for. But now I have no idea what to do and I need it bad.
– Ady96
Nov 26 at 18:27
Remember to check whether your VPS provider supports starting virtual machines from LVM.
– Henrik
Nov 26 at 18:43
there is no way I can reinstall system, copy data, etc...I am looking for a solution as it is now, there must be some way
– Ady96
Nov 26 at 18:48
If your VPS provider alllows to grow virtual disks, it can be done. but we cannot guess it.
– Rui F Ribeiro
Nov 26 at 18:51
Are... you sure this is LVM? This doesn't look like an LVM setup...
– Thomas Ward
Nov 26 at 18:57
Well yes, thats what I have found out too. I had no idea when installing system, that I need LVM ...didn't even know what its for. But now I have no idea what to do and I need it bad.
– Ady96
Nov 26 at 18:27
Well yes, thats what I have found out too. I had no idea when installing system, that I need LVM ...didn't even know what its for. But now I have no idea what to do and I need it bad.
– Ady96
Nov 26 at 18:27
Remember to check whether your VPS provider supports starting virtual machines from LVM.
– Henrik
Nov 26 at 18:43
Remember to check whether your VPS provider supports starting virtual machines from LVM.
– Henrik
Nov 26 at 18:43
there is no way I can reinstall system, copy data, etc...I am looking for a solution as it is now, there must be some way
– Ady96
Nov 26 at 18:48
there is no way I can reinstall system, copy data, etc...I am looking for a solution as it is now, there must be some way
– Ady96
Nov 26 at 18:48
If your VPS provider alllows to grow virtual disks, it can be done. but we cannot guess it.
– Rui F Ribeiro
Nov 26 at 18:51
If your VPS provider alllows to grow virtual disks, it can be done. but we cannot guess it.
– Rui F Ribeiro
Nov 26 at 18:51
Are... you sure this is LVM? This doesn't look like an LVM setup...
– Thomas Ward
Nov 26 at 18:57
Are... you sure this is LVM? This doesn't look like an LVM setup...
– Thomas Ward
Nov 26 at 18:57
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
You can simply use sfdisk to resize the 2nd partition.
# write the current partition table into a machine readable text file
sfdisk --dump /dev/vda > /var/tmp/vda.old
cp /var/tmp/vda.old /var/tmp/vda.new
# also copy vda.old to another machine to have a safe backup
# edit the dump to set the new size for partion 2
# (you may remove the size parameter ", size= 1234" and the
# whole line "last-lba: 1234" to get the max possible size)
vim /var/tmp/vda.new
# now apply the edited partition table to the harddisk
sfdisk --no-reread /dev/vda </var/tmp/vda.new
# check if it looks good, otherwise repair/try again
fdisk -l /dev/vda
# after reboot, resize the filesystem too, for example in case of ext2,3,4
resize2fs /dev/vda2
Note, you can do this without using LVM because there is free space on your HD directly after the partition you want to resize. With LVM you would not have to reboot and also the whole resizing steps would look a bit less dangerous. So in general I would recommend to use LVM from the beginning, when installing the server. But for you it should work here also without LVM.
I don't understand the last part, is this what I can apply to my filesystem?
– Ady96
Nov 26 at 18:50
when I got to step to apply edited partition, I got a message in RED saying that disk is currently in use, that I should unmount all file systems and swapoff all swap partitions on this disk, or use--no-reread flagto suppress this check. what now?
– Ady96
Nov 26 at 19:53
okay, I used--forceflag as it said, I updated my question with a picture of what it says
– Ady96
Nov 26 at 20:09
okay so I run:/sfdisk /dev/vda < /var/tmp/vda.old --force, I got back output as updated in my question, please check if its all good, cause if I loose it, ...
– Ady96
Nov 26 at 20:18
Updated the comment how to edit the size parameter to get the max possible size. (remove the whole size parameter inclusive one comma, not only the former value).
– rudimeier
Nov 26 at 20:21
|
show 8 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You can simply use sfdisk to resize the 2nd partition.
# write the current partition table into a machine readable text file
sfdisk --dump /dev/vda > /var/tmp/vda.old
cp /var/tmp/vda.old /var/tmp/vda.new
# also copy vda.old to another machine to have a safe backup
# edit the dump to set the new size for partion 2
# (you may remove the size parameter ", size= 1234" and the
# whole line "last-lba: 1234" to get the max possible size)
vim /var/tmp/vda.new
# now apply the edited partition table to the harddisk
sfdisk --no-reread /dev/vda </var/tmp/vda.new
# check if it looks good, otherwise repair/try again
fdisk -l /dev/vda
# after reboot, resize the filesystem too, for example in case of ext2,3,4
resize2fs /dev/vda2
Note, you can do this without using LVM because there is free space on your HD directly after the partition you want to resize. With LVM you would not have to reboot and also the whole resizing steps would look a bit less dangerous. So in general I would recommend to use LVM from the beginning, when installing the server. But for you it should work here also without LVM.
I don't understand the last part, is this what I can apply to my filesystem?
– Ady96
Nov 26 at 18:50
when I got to step to apply edited partition, I got a message in RED saying that disk is currently in use, that I should unmount all file systems and swapoff all swap partitions on this disk, or use--no-reread flagto suppress this check. what now?
– Ady96
Nov 26 at 19:53
okay, I used--forceflag as it said, I updated my question with a picture of what it says
– Ady96
Nov 26 at 20:09
okay so I run:/sfdisk /dev/vda < /var/tmp/vda.old --force, I got back output as updated in my question, please check if its all good, cause if I loose it, ...
– Ady96
Nov 26 at 20:18
Updated the comment how to edit the size parameter to get the max possible size. (remove the whole size parameter inclusive one comma, not only the former value).
– rudimeier
Nov 26 at 20:21
|
show 8 more comments
up vote
1
down vote
accepted
You can simply use sfdisk to resize the 2nd partition.
# write the current partition table into a machine readable text file
sfdisk --dump /dev/vda > /var/tmp/vda.old
cp /var/tmp/vda.old /var/tmp/vda.new
# also copy vda.old to another machine to have a safe backup
# edit the dump to set the new size for partion 2
# (you may remove the size parameter ", size= 1234" and the
# whole line "last-lba: 1234" to get the max possible size)
vim /var/tmp/vda.new
# now apply the edited partition table to the harddisk
sfdisk --no-reread /dev/vda </var/tmp/vda.new
# check if it looks good, otherwise repair/try again
fdisk -l /dev/vda
# after reboot, resize the filesystem too, for example in case of ext2,3,4
resize2fs /dev/vda2
Note, you can do this without using LVM because there is free space on your HD directly after the partition you want to resize. With LVM you would not have to reboot and also the whole resizing steps would look a bit less dangerous. So in general I would recommend to use LVM from the beginning, when installing the server. But for you it should work here also without LVM.
I don't understand the last part, is this what I can apply to my filesystem?
– Ady96
Nov 26 at 18:50
when I got to step to apply edited partition, I got a message in RED saying that disk is currently in use, that I should unmount all file systems and swapoff all swap partitions on this disk, or use--no-reread flagto suppress this check. what now?
– Ady96
Nov 26 at 19:53
okay, I used--forceflag as it said, I updated my question with a picture of what it says
– Ady96
Nov 26 at 20:09
okay so I run:/sfdisk /dev/vda < /var/tmp/vda.old --force, I got back output as updated in my question, please check if its all good, cause if I loose it, ...
– Ady96
Nov 26 at 20:18
Updated the comment how to edit the size parameter to get the max possible size. (remove the whole size parameter inclusive one comma, not only the former value).
– rudimeier
Nov 26 at 20:21
|
show 8 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You can simply use sfdisk to resize the 2nd partition.
# write the current partition table into a machine readable text file
sfdisk --dump /dev/vda > /var/tmp/vda.old
cp /var/tmp/vda.old /var/tmp/vda.new
# also copy vda.old to another machine to have a safe backup
# edit the dump to set the new size for partion 2
# (you may remove the size parameter ", size= 1234" and the
# whole line "last-lba: 1234" to get the max possible size)
vim /var/tmp/vda.new
# now apply the edited partition table to the harddisk
sfdisk --no-reread /dev/vda </var/tmp/vda.new
# check if it looks good, otherwise repair/try again
fdisk -l /dev/vda
# after reboot, resize the filesystem too, for example in case of ext2,3,4
resize2fs /dev/vda2
Note, you can do this without using LVM because there is free space on your HD directly after the partition you want to resize. With LVM you would not have to reboot and also the whole resizing steps would look a bit less dangerous. So in general I would recommend to use LVM from the beginning, when installing the server. But for you it should work here also without LVM.
You can simply use sfdisk to resize the 2nd partition.
# write the current partition table into a machine readable text file
sfdisk --dump /dev/vda > /var/tmp/vda.old
cp /var/tmp/vda.old /var/tmp/vda.new
# also copy vda.old to another machine to have a safe backup
# edit the dump to set the new size for partion 2
# (you may remove the size parameter ", size= 1234" and the
# whole line "last-lba: 1234" to get the max possible size)
vim /var/tmp/vda.new
# now apply the edited partition table to the harddisk
sfdisk --no-reread /dev/vda </var/tmp/vda.new
# check if it looks good, otherwise repair/try again
fdisk -l /dev/vda
# after reboot, resize the filesystem too, for example in case of ext2,3,4
resize2fs /dev/vda2
Note, you can do this without using LVM because there is free space on your HD directly after the partition you want to resize. With LVM you would not have to reboot and also the whole resizing steps would look a bit less dangerous. So in general I would recommend to use LVM from the beginning, when installing the server. But for you it should work here also without LVM.
edited Nov 26 at 21:16
answered Nov 26 at 18:42
rudimeier
5,3771632
5,3771632
I don't understand the last part, is this what I can apply to my filesystem?
– Ady96
Nov 26 at 18:50
when I got to step to apply edited partition, I got a message in RED saying that disk is currently in use, that I should unmount all file systems and swapoff all swap partitions on this disk, or use--no-reread flagto suppress this check. what now?
– Ady96
Nov 26 at 19:53
okay, I used--forceflag as it said, I updated my question with a picture of what it says
– Ady96
Nov 26 at 20:09
okay so I run:/sfdisk /dev/vda < /var/tmp/vda.old --force, I got back output as updated in my question, please check if its all good, cause if I loose it, ...
– Ady96
Nov 26 at 20:18
Updated the comment how to edit the size parameter to get the max possible size. (remove the whole size parameter inclusive one comma, not only the former value).
– rudimeier
Nov 26 at 20:21
|
show 8 more comments
I don't understand the last part, is this what I can apply to my filesystem?
– Ady96
Nov 26 at 18:50
when I got to step to apply edited partition, I got a message in RED saying that disk is currently in use, that I should unmount all file systems and swapoff all swap partitions on this disk, or use--no-reread flagto suppress this check. what now?
– Ady96
Nov 26 at 19:53
okay, I used--forceflag as it said, I updated my question with a picture of what it says
– Ady96
Nov 26 at 20:09
okay so I run:/sfdisk /dev/vda < /var/tmp/vda.old --force, I got back output as updated in my question, please check if its all good, cause if I loose it, ...
– Ady96
Nov 26 at 20:18
Updated the comment how to edit the size parameter to get the max possible size. (remove the whole size parameter inclusive one comma, not only the former value).
– rudimeier
Nov 26 at 20:21
I don't understand the last part, is this what I can apply to my filesystem?
– Ady96
Nov 26 at 18:50
I don't understand the last part, is this what I can apply to my filesystem?
– Ady96
Nov 26 at 18:50
when I got to step to apply edited partition, I got a message in RED saying that disk is currently in use, that I should unmount all file systems and swapoff all swap partitions on this disk, or use
--no-reread flag to suppress this check. what now?– Ady96
Nov 26 at 19:53
when I got to step to apply edited partition, I got a message in RED saying that disk is currently in use, that I should unmount all file systems and swapoff all swap partitions on this disk, or use
--no-reread flag to suppress this check. what now?– Ady96
Nov 26 at 19:53
okay, I used
--force flag as it said, I updated my question with a picture of what it says– Ady96
Nov 26 at 20:09
okay, I used
--force flag as it said, I updated my question with a picture of what it says– Ady96
Nov 26 at 20:09
okay so I run:
/sfdisk /dev/vda < /var/tmp/vda.old --force , I got back output as updated in my question, please check if its all good, cause if I loose it, ...– Ady96
Nov 26 at 20:18
okay so I run:
/sfdisk /dev/vda < /var/tmp/vda.old --force , I got back output as updated in my question, please check if its all good, cause if I loose it, ...– Ady96
Nov 26 at 20:18
Updated the comment how to edit the size parameter to get the max possible size. (remove the whole size parameter inclusive one comma, not only the former value).
– rudimeier
Nov 26 at 20:21
Updated the comment how to edit the size parameter to get the max possible size. (remove the whole size parameter inclusive one comma, not only the former value).
– rudimeier
Nov 26 at 20:21
|
show 8 more comments
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2funix.stackexchange.com%2fquestions%2f484261%2fresize-partition-without-using-lvm%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
Well yes, thats what I have found out too. I had no idea when installing system, that I need LVM ...didn't even know what its for. But now I have no idea what to do and I need it bad.
– Ady96
Nov 26 at 18:27
Remember to check whether your VPS provider supports starting virtual machines from LVM.
– Henrik
Nov 26 at 18:43
there is no way I can reinstall system, copy data, etc...I am looking for a solution as it is now, there must be some way
– Ady96
Nov 26 at 18:48
If your VPS provider alllows to grow virtual disks, it can be done. but we cannot guess it.
– Rui F Ribeiro
Nov 26 at 18:51
Are... you sure this is LVM? This doesn't look like an LVM setup...
– Thomas Ward
Nov 26 at 18:57