Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a VPS with "EDIS" and recently they added extra 5GB of storage which I don't know how to use.
I tried asking them, they either don't know how to add it or doesn't want to help.
the server uses Debian 7, here is some info that I think is helpful, but I'm not sure what to do with it:
Code:
fdisk -ls
Disk /dev/vda: 16.1 GB, 16106127360 bytes
16 heads, 63 sectors/track, 31207 cylinders, total 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00055096
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 194559 96256 83 Linux
/dev/vda2 194560 10000383 4902912 83 Linux
/dev/vda3 10000384 10483711 241664 82 Linux swap / Solaris
Code:
(parted) print free
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 16.1GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
32.3kB 1049kB 1016kB Free Space
1 1049kB 99.6MB 98.6MB primary ext3 boot
2 99.6MB 5120MB 5021MB primary xfs
3 5120MB 5368MB 247MB primary linux-swap(v1)
5368MB 16.1GB 10.7GB Free Space
Of course I don't want to lose data and I can't unmount anything.
Thank you for your help.
you won't be able to increase this without a reboot, since the kernel will refuse to reload the system table.
It's possible but more risk to get this down to just a reboot for downtime but as it is riskier, I'd advise using a proper tool such as gparted.
If you want a summary of the riskier method it'd be this.
swapoff /dev/vda3
fdisk -u /dev/sda
delete /dev/vda3
delete /dev/vda2
create /dev/vda2 at the same start location but 5G larger for end location
create new /dev/vda3 at new location
save
Reboot
xfs_growf /dev/vda2
This is definitely risker, if you recreate the partition wrong then it could be good game to your data and so unless you are willing to take such risks, I'd advise using a proper/dedicated tool for this work instead.
Last edited by r3sistance; 02-21-2017 at 01:34 PM.
The way I do it (and it's lazy), is I keep an image of the latest gparted .iso on my machine, and temporarily attach that as the cd-rom, then boot to it, do all the resizing from the live iso (with most of it being done through gparted obviously), then reboot into the actual machine. THis way I never have to worry about resizing a running filesystem (even though growing running filesystems shouldn't usually be an issue, I've been burned before).
you won't be able to increase this without a reboot, since the kernel will refuse to reload the system table.
It's possible but more risk to get this down to just a reboot for downtime but as it is riskier, I'd advise using a proper tool such as gparted.
If you want a summary of the riskier method it'd be this.
swapoff /dev/vda3
fdisk -u /dev/sda
delete /dev/vda3
delete /dev/vda2
create /dev/vda2 at the same start location but 5G larger for end location
create new /dev/vda3 at new location
save
Reboot
xfs_growf /dev/vda2
This is definitely risker, if you recreate the partition wrong then it could be good game to your data and so unless you are willing to take such risks, I'd advise using a proper/dedicated tool for this work instead.
Why am I deleting all the partitions ? can't I delete just vda2 and create new partition instead ?
I don't have issues rebooting the system, not sure what you meant there.
Why am I deleting all the partitions ? can't I delete just vda2 and create new partition instead ?
I don't have issues rebooting the system, not sure what you meant there.
I'd highly advise to use a proper tool like gparted, sure it will mean more downtime but right now you probably aren't familiar enough with partitions to be doing something risky like this on a production system. If you insist/want to do it this way, my advice is build a test machine and do it several times there first in tests.
But to answer your question, where are you going to expand vda2? vda3 is in the way. vda3 is only swap anyways, so what does it matter? it is just an extension of the paging system. So you can move vda3 completely. admittedly this is only a summary and I missed the mkswap step on vda3
Last edited by r3sistance; 02-22-2017 at 05:27 AM.
I would also strongly suggest that you use LVM = Logical Volume Management.
With this feature, you can add and remove physical storage on-the-fly. And, you no longer have to be terribly concerned with physical partitioning since you are free to establish whatever logical picture you prefer. "Running out of space on a volume," which can be an extremely difficult thing to work out without LVM, becomes quite trivial to deal with if you do have it.
I install this feature on all of my Linux boxes as a matter of routine.
I would also strongly suggest that you use LVM = Logical Volume Management.
With this feature, you can add and remove physical storage on-the-fly. And, you no longer have to be terribly concerned with physical partitioning since you are free to establish whatever logical picture you prefer. "Running out of space on a volume," which can be an extremely difficult thing to work out without LVM, becomes quite trivial to deal with if you do have it.
I install this feature on all of my Linux boxes as a matter of routine.
I agree with the above, but doesn't really help with an already live production system unfortunately...
as it goes, for VMs I would look to having LVM running on a separate unpartitioned/raw disk, since without partitioning you can actually increase the size of the LVM even easier. So currently I get something like this...
/sda1 = /boot
/sdb = LVM PV
Unfortunately I don't have a good test box set-up like that right now tho...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.