Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hi,
I need to resize /. It was 3068MB, but only 7% are left after a mere gentoo install, without any window manager (I won't install any btw, it's for a server)
So I thought I could try parted but I'm not sure of what to do. Here's my partition scheme
/dev/sda12048MB swap
/dev/sda2 510MB /boot
/devsda3 3068MB /
/dev/mapper/volume 13GB (LVM)
I have 4 GB of free space
So, what's the idea ? Just resize / with a new END value, and parted will fetch fre space itself, or delete LVM, then resize / then recreate LVM ?
BTW, I made a parted boot floppy, but it asks for a second disk whan booting... Where's that one ?
Well, you could create a /usr partition I suppose... But you should be able to resize okay... Can you use a bootable CD distro for the resize?
Yes, I have severeal bootable CD's. But I'm afraid I don't catch the next step. I'm not used at all with parted. What would be the idea after booting from the cd ?
What do you have on LVM? /usr? /var? /home? /tmp? Or are all these just directories under / and not seperate mountpoints?
The outputs of the "mount" command, "df", and "fdisk -l" would be helpful. What you supplied looks to be a manually typed description that doesn't tell the whole story.
You should be able to run something like qparted from some cd distro... A gui tool should do all the work for you... Not sure. I use the mandrake gui shell to the partion tools to be honest, so not sure about parted details. I resize partitions with mandriva and it does all the inodes and stuff and I don't take too much notice I'd have to read up a bit on parted itself... From what I read on parted, the start of the partition must remain fixed (fair enough) and you shift the end...
What do you have on LVM? /usr? /var? /home? /tmp? Or are all these just directories under / and not seperate mountpoints?
The outputs of the "mount" command, "df", and "fdisk -l" would be helpful. What you supplied looks to be a manually typed description that doesn't tell the whole story.
Well, I can give the output, but the whole setup is quite simple :
/boot is sda1
/swap is sda2
/ is sda3 (with all the directories you named)
lvm is used for vservers (3 of them at the moment)
My problem is that I don't know if I can directly resize and parted will find free space all by itself or if I should delete the lvm first, then resize, then recreate it.
You should be able to run something like qparted from some cd distro... A gui tool should do all the work for you... Not sure. I use the mandrake gui shell to the partion tools to be honest, so not sure about parted details. I resize partitions with mandriva and it does all the inodes and stuff and I don't take too much notice I'd have to read up a bit on parted itself... From what I read on parted, the start of the partition must remain fixed (fair enough) and you shift the end...
"Do you think the partition tool will resize my parts without destroying data ?"
That's what it is designed to do. As I say, I have used the mandr* gui tools to resize partitions a lot in the past, but not parted itself... They do warn you to backup the data first tho
"Do you think the partition tool will resize my parts without destroying data ?"
That's what it is designed to do. As I say, I have used the mandr* gui tools to resize partitions a lot in the past, but not parted itself... They do warn you to backup the data first tho
What I did want to mention earlier was I wonder where the 'free space' is. An output of
fdisk -l
would be a help to see if the partition would be easy to resize or not.
Depending on where the sapce is and how the drive(s) is arranged, you may have to do something else, like create a /usr partition on the 4gig free (whereever it is)...
No real need. It sounds like you have a plan already. I was going to suggest an alternate.
To me it looks like your current layout might not be the best for a server. Your /boot is huge. swap seems quite large as well, given it appears you only have about a 25Gb disk, which makes me think it's an older system that wouldn't have a large amount of ram to justify that size of swap. However, depending on what apps your server runs you may really desire a swap that large. Just trying to save you a little disk space since you are already tight and evidently only have a small disk.
My recommendation would be to cut /boot down to maybe only 30Mb and swap to 500Mb. Make / only about 300Mb and pull /usr, /var, /opt, /home, /tmp, and /usr/local off of /, and put them on LVM as seperate mountpoints. As a variation, you could symlink /opt to /usr/local rather than have these two as individual mountpoints.
The above might leave your partitioning looking something like this:
(This scheme pretty much describes the Linux portion of one of my home computers, omitting the other partitions used for dual-booting, other attached disks used for backup, etc.)
This would position you for flexibility on your server, and you could always add a second disk in the future and grow your existing LVM for either your standard filesystems, or your vservers. This is pretty much a start-from-scratch suggestion. But your existing / is small enough that you could in theory boot with Knoppix and copy all of / off to a DVD (if you have a burner on this system) and use that to reinstall from. You'd need to rearrange things in your bootloader and probably recreate a new initrd if your system uses that. Possibly more work than you intended. The easy way would be to go buy a new bigger disk, partition it tightly and put everything practical on LVM, then copy your existing install from the old disk to the new.
Whatever you end up doing, don't ever depend on anything working "without destroying data". Any time you do things at this level with your OS you're taking a risk. Resizing or rearranging partitions is inherently risky. Make sure you have good backups if your data is important to you.
No real need. It sounds like you have a plan already. I was going to suggest an alternate.
To me it looks like your current layout might not be the best for a server. Your /boot is huge. swap seems quite large as well, given it appears you only have about a 25Gb disk, which makes me think it's an older system that wouldn't have a large amount of ram to justify that size of swap. However, depending on what apps your server runs you may really desire a swap that large. Just trying to save you a little disk space since you are already tight and evidently only have a small disk.
My recommendation would be to cut /boot down to maybe only 30Mb and swap to 500Mb. Make / only about 300Mb and pull /usr, /var, /opt, /home, /tmp, and /usr/local off of /, and put them on LVM as seperate mountpoints. As a variation, you could symlink /opt to /usr/local rather than have these two as individual mountpoints.
The above might leave your partitioning looking something like this:
(This scheme pretty much describes the Linux portion of one of my home computers, omitting the other partitions used for dual-booting, other attached disks used for backup, etc.)
This would position you for flexibility on your server, and you could always add a second disk in the future and grow your existing LVM for either your standard filesystems, or your vservers. This is pretty much a start-from-scratch suggestion. But your existing / is small enough that you could in theory boot with Knoppix and copy all of / off to a DVD (if you have a burner on this system) and use that to reinstall from. You'd need to rearrange things in your bootloader and probably recreate a new initrd if your system uses that. Possibly more work than you intended. The easy way would be to go buy a new bigger disk, partition it tightly and put everything practical on LVM, then copy your existing install from the old disk to the new.
Whatever you end up doing, don't ever depend on anything working "without destroying data". Any time you do things at this level with your OS you're taking a risk. Resizing or rearranging partitions is inherently risky. Make sure you have good backups if your data is important to you.
Thanks you for this detailed answer.
I was in a hurry, so I finally tarred the system, repartionned it and then extracted it again. It took only minor adjustments to be up and running again.
However, I'll keep your idea in mind for the next install
Cheers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.