You are not logged in.

#1 2008-10-14 02:08:03

rsw
Member
Registered: 2008-10-07
Posts: 25

[SOLVED]root file system partition too small

O.K. so I have this stupid problem:

[rsw@myhost ~]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3              2542076   2320972     92988  97% /
none                     94784         0     94784   0% /dev/shm
/dev/sda4             12041420   2406244   9028324  22% /home
/dev/sda1                38888      8336     28544  23% /boot

When I set up my partitions I expected 2.5 gigs to stretch a little farther than this.  is there any way to resize it without formating the drive and starting over?

Last edited by rsw (2008-10-16 00:52:02)

Offline

#2 2008-10-14 02:27:04

virati
Member
Registered: 2008-04-14
Posts: 83

Re: [SOLVED]root file system partition too small

I ran into the same problem thinking i wouldn't use arch64 as much as i do.

All i did was copy+pasted my /opt directory into a seperate partition (in my case my huge other harddrive that was just sitting there). Then i just
"mount --bind /dev/(other partition)/optcopied /opt". It freed up a LOT of space. You could theoretically do this to any partition (/usr/share or /bin or whatever).

Hopefully that helps. If you're looking to extend your root, I don't think that's a reasonable way to go, at least from the research I did when i was at 99% of root disk usage.

Last edited by virati (2008-10-14 02:27:23)

Offline

#3 2008-10-14 03:06:48

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [SOLVED]root file system partition too small

Not an *easy* way to actually resize it...

There's ways around it though... When this happened on my old server (2gb hdd), I still had a heap of free room on /var  (like you do on /home) so I did this:

dd if=/dev/zero of=/var/usr.iso bs=1M count=1024   # 1gb
mkfs /var/usr.iso
modprobe loop
mkdir -t ext3 -o loop /var/usr.iso /mnt/new-usr
cp -a /usr/* /mnt/new-usr
rm -Rf /usr
umount /mnt/new-usr
mount /var/usr.iso /usr

Making a file system within a file on another partition. I know it's a nasty hack; but it still works smile   Kept my server going fine for another couple of months until I got my new one (with a 500gb RAID-1 tongue)

Find a directory in your / partition that is taking up the most space, and move it off to this file.

If you use a file system that supports resizing (eg, xfs or jfs) then in theory you could increase the size of the file later on if you need more space.

dd if=/dev/zero of=/var/bigger.iso bs=1M count=256   # 256mb
cat /usr/bigger.iso >> /var/usr.iso
mount -o remount,resize /usr

UNTESTED, JUST A THEORY.

Offline

#4 2008-10-14 10:40:10

afonic
Member
Registered: 2007-06-21
Posts: 53

Re: [SOLVED]root file system partition too small

Can't you just grow the partion using something like Gparted live CD?


Your source for video guides!
My Linux reviews.
Currently using: Intel Core 2 Quad Q9300 @ 3.5GHz, 2GB RAM, Asus P5E, nVidia Geforce 8800GTS, Arch Linux

Offline

#5 2008-10-14 11:11:23

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED]root file system partition too small

afonic wrote:

Can't you just grow the partion using something like Gparted live CD?

Exactly. Can't you ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#6 2008-10-14 12:08:22

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: [SOLVED]root file system partition too small

I believe that would depend on where the partition is relative to others on the disk; i.e. if root was created first, there are most likely other partitions "after" it on the disk, so there's nowhere for the partition to grow. Obviously it's too late now, but this is one argument for using LVM2, which adds a layer of indirection between partitions and physical disks; I use LVM2 and a filesystem that can grow online, and dealing with situations like this is pretty easy. Again, a little late in this case...


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#7 2008-10-14 12:25:41

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED]root file system partition too small

nogoma wrote:

I believe that would depend on where the partition is relative to others on the disk; i.e. if root was created first, there are most likely other partitions "after" it on the disk, so there's nowhere for the partition to grow. Obviously it's too late now, but this is one argument for using LVM2, which adds a layer of indirection between partitions and physical disks; I use LVM2 and a filesystem that can grow online, and dealing with situations like this is pretty easy. Again, a little late in this case...

Not quite. There can always be more shrinking and enlarging, working up to the root partition. It takes more time, but you just load up a live CD, tell it what to do and wait a few hours while doing something else. Much better than re-installing.


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#8 2008-10-14 12:43:24

Execute_Method
Member
From: Tennessee
Registered: 2008-07-26
Posts: 105

Re: [SOLVED]root file system partition too small

moljac024 wrote:
afonic wrote:

Can't you just grow the partion using something like Gparted live CD?

Exactly. Can't you ?

That's exactly what I did. I first shrank my home partition (which if you use the standard partitioning scheme, will be directly after root), but made sure to empty the home partition of just about everything in it. Then I grew the root partition to fill the space left.

When you grow the root partition TOWARD the END of the drive, it doesn't touch any of the data before the end of the partition, it only "tacks on" the extra. However, when you shrink the home partition, Gparted will have to move all the data around, which is really the only place that something could go wrong.

Even though the chances of failure are unlikely, you should make a backup first (as with any action that could potentially cause data loss)

Here's the URL
http://gparted.sourceforge.net/livecd.php

Offline

#9 2008-10-14 12:52:49

Execute_Method
Member
From: Tennessee
Registered: 2008-07-26
Posts: 105

Re: [SOLVED]root file system partition too small

rsw wrote:

O.K. so I have this stupid problem:

[rsw@myhost ~]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3              2542076   2320972     92988  97% /
none                     94784         0     94784   0% /dev/shm
/dev/sda4             12041420   2406244   9028324  22% /home
/dev/sda1                38888      8336     28544  23% /boot

When I set up my partitions I expected 2.5 gigs to stretch a little farther than this.  is there any way to resize it without formating the drive and starting over?

Yep, your home partition is directly after the root partition, so what I suggested should work, however, give good consideration to the size of each, considering you don't have another drive (according to df) to use for storage. Personally, I only have 12GB on my home partition (after resizing) and now have 23GB on root.

Here's mine.

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb3             22864180   7438764  14503608  34% /
none                    517648       548    517100   1% /dev/shm
/dev/sdb4             11897496   5947088   5470708  53% /home
/dev/sdb1                38888     22534     14346  62% /boot
/dev/sda1            155059036  37878624 109365872  26% /media/thevault
/dev/sdc1            116294120  84739460  25693748  77% /media/music

Last edited by Execute_Method (2008-10-14 12:53:41)

Offline

#10 2008-10-14 12:52:57

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED]root file system partition too small

I've done this numerous times with that liveCD.
Shrinking and enlarging multiple partitions, some toward the beginning and some towards the end, and never had any data loss.
But it's slow as hell, though...


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#11 2008-10-14 12:55:47

Execute_Method
Member
From: Tennessee
Registered: 2008-07-26
Posts: 105

Re: [SOLVED]root file system partition too small

moljac024 wrote:

I've done this numerous times with that liveCD.
Shrinking and enlarging multiple partitions, some toward the beginning and some towards the end, and never had any data loss.
But it's slow as hell, though...

I agree, liveCD, works well, and (for me) has been a really safe bet, when in a data crunch

Offline

#12 2008-10-16 00:53:24

rsw
Member
Registered: 2008-10-07
Posts: 25

Re: [SOLVED]root file system partition too small

Thanks for the advice all.  I'm sure it was really good advice (and will probably be trying it out in the future) but I solved the problem by doing pacman -Scc (or something like that).  Whatever it was that I did, it cleared the cache of downloaded packages and freed about 50% of that partition, which is more along the lines of where I had expected to be in terms of disk usage right now.  Thanks all!

Last edited by rsw (2008-10-16 00:53:57)

Offline

Board footer

Powered by FluxBB