Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
It looks like the OP is running a Xen virtual machine.
You can not use fdisk to move partitions. I don't use Xen but I suppose you can boot a gparted ISO to move the extended partition to the end and resize xvda1. Create a backup first just in case.
just to make it even more difficult. But anyway, OP can add a second disk, move /home onto it, remove all the extended partitions, including xvda2, resize root, move home back (but this time use a new primary partition) and finally create a new swap.
In addition to what has been suggested, you don't seem to have given much thought to this before doing it. A 10GB drive? What are you putting on it? Slitaz, TinyCore. If you look at the total sectors from the fdisk output, you can see that the drive is now double (20GB) what it was but you have done nothing with the partitions on the drive. As pointed out, xvda2 is an Extended partition containing xvda5 and xvda6. You could extend xvda6 to the end of the drive which would make you /home partition about 15GB. You need to have xvda5 and xvda6 unmounted and then extend xvda2 to the end of the drive and then extend xvda6 also to the end of the drive.
Since it is xvda1 that is full, this won't help but the same process would be needed. Unmount the logical partitions (do a backup if there is any meaningful data), extend xvda2 to the end of the drive and move the beginning of xvda5 and 6 to the end of the drive then move the beginning of xvda2 to the right. Sound like fun? Simplest would be to start over and if you have any data, first do a backup. You might consider using gpt rather than dos partition table.
FYI: Regarding the larger issue, may I also point you to LVM = Logical Volume Manager, which is usually installed by default. (And, IMHO, definitely should be.)
This very important facility defines "the mount-points that you see and use" as "logical volumes" that are carved out of "storage pools" which can seamlessly span multiple physical devices. So, if you "run out of space," you install a new volume, add it to the "storage pool," and then expand the filesystem to recognize the new space. (You can expand a filesystem without downtime.)
LVM is a thoroughly-designed facility which also has effective solutions for problems such as: "ominous clicking noises." You can reliably move everything off of the failing drive, again without downtime.
Last edited by sundialsvcs; 03-04-2024 at 05:39 PM.
LVM = Logical Volume Manager, which is usually installed by default. (And, IMHO, definitely should be.)
I disagree. Disks are large enough now that LVM really isn't needed -- for home use that is. LVM seems more geared to commercial use. I mean 1TB is now around $100. No excuse for small disks in the home environment IMHO. My OS drive is a 2TB SSD (formatted ext4) with only around 100GB used. As for VMs, I give a minimum of 50GB to each of them depending on what I use them for. Never had to care whether to 'expand' a VM disk which I think above OP must be using? Again no need for LVM... Not sure LVM would be useful in a VM anyway.
My point was never that "you might actually need to use it, these days," but simply that: "if you 'find yourself short,' you can."
And in quite a few(!) "cloud-based (virtual machine ...) client deployments," this (over time) turned out to be a major life-saver. Because real-world websites accumulate "database rows" and "downloaded images and such" with rather-frightening speed. You can very quickly purchase another "hunk of storage" from the vendor, and "put it online and keep running." (It's not my preferred way of doing things, but you gotta do what you gotta do.) The running system does not perceive the existence nor the boundaries of the "successive purchases."
Last edited by sundialsvcs; 03-04-2024 at 08:23 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.