LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 01-27-2006, 07:02 PM   #1
cantabile
LQ Newbie
 
Registered: Jan 2004
Posts: 28

Rep: Reputation: 15
Resizing / ?


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 ?

Thx for your help !
 
Old 01-27-2006, 07:31 PM   #2
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
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?
 
Old 01-27-2006, 07:37 PM   #3
cantabile
LQ Newbie
 
Registered: Jan 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by amosf
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 ?
 
Old 01-27-2006, 07:53 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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.
 
Old 01-27-2006, 07:54 PM   #5
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
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...

There is a parted manual at:
http://www.gnu.org/software/parted/m...no/parted.html
 
Old 01-27-2006, 07:58 PM   #6
cantabile
LQ Newbie
 
Registered: Jan 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by haertig
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.

But I'll give the outputs if you like.
 
Old 01-27-2006, 08:00 PM   #7
cantabile
LQ Newbie
 
Registered: Jan 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by amosf
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...

There is a parted manual at:
http://www.gnu.org/software/parted/m...no/parted.html
It's been quite a time I didn't try mandriva. Do you think the partition tool will resize my parts without destroying data ?
 
Old 01-27-2006, 08:08 PM   #8
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
"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
 
Old 01-27-2006, 08:10 PM   #9
cantabile
LQ Newbie
 
Registered: Jan 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by amosf
"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
Okay. Downloading...
Thanks !
 
Old 01-27-2006, 08:23 PM   #10
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
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)...
 
Old 01-27-2006, 09:18 PM   #11
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by cantabile
But I'll give the outputs if you like.
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:

hda1 30Mb /boot
hda2 300Mb /
hda3 500Mb swap
hda4 remainder_of_disk LVM (includes /usr, /var, vservers, etc.)

(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.
 
Old 01-29-2006, 01:03 PM   #12
cantabile
LQ Newbie
 
Registered: Jan 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by haertig
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:

hda1 30Mb /boot
hda2 300Mb /
hda3 500Mb swap
hda4 remainder_of_disk LVM (includes /usr, /var, vservers, etc.)

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ext3 resizing Josh328 Linux - General 5 07-31-2005 02:19 AM
resizing my display discourse SUSE / openSUSE 3 06-18-2005 07:54 AM
resizing xboard? synaptical Linux - Software 0 01-12-2004 12:22 PM
resizing in Fluxbox ludwig W Linux - General 2 05-12-2003 07:23 PM
Need help in Resizing bubble Linux - General 0 02-03-2002 12:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration