Resize partition without using LVM

The name of the pictureThe name of the pictureThe name of the pictureClash 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:



enter image description here



Edit:



this is what I got regarding to answer below:



enter image description here



enter image description here



enter image description here



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









share|improve this question























  • 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














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:



enter image description here



Edit:



this is what I got regarding to answer below:



enter image description here



enter image description here



enter image description here



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









share|improve this question























  • 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












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:



enter image description here



Edit:



this is what I got regarding to answer below:



enter image description here



enter image description here



enter image description here



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









share|improve this question















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:



enter image description here



Edit:



this is what I got regarding to answer below:



enter image description here



enter image description here



enter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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










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.






share|improve this answer






















  • 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










  • 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










  • 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











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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/3.0/"u003ecc by-sa 3.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
);



);













draft saved

draft discarded


















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

























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.






share|improve this answer






















  • 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










  • 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










  • 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















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.






share|improve this answer






















  • 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










  • 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










  • 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













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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








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 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 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










  • 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 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


















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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






Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)