You are not logged in.

#1 2010-10-26 06:27:58

jocom
Member
Registered: 2009-04-29
Posts: 74

Resizing /var, /tmp and swap partition

Hello,

Some time ago I installed Arch with the following partition table:
---
Number  Start   End     Size    Type      File system     Flags
1      32.3kB  247MB   247MB   primary   ext4            boot
2      247MB   50.2GB  50.0GB  primary   ext4
3      50.2GB  62.2GB  12.0GB  extended
5      50.2GB  54.2GB  3997MB  logical   ext4
6      54.2GB  58.2GB  3997MB  logical   ext4
7      60.1GB  62.2GB  2121MB  logical   linux-swap(v1)
4      62.2GB  204GB   142GB   primary   ext3
---
With /dev/sdb5 = /var; 6 = /tmp; 7=swap.

I managed to resize the swap (as you can see [for there is a gap between 6 and 7]) with gparted. But it seems to be impossible to resize /var and /tmp with a gui. I would like to reduce 6=/tmp to 2GB and increase 5=/var to 8GB. For my /var is nearly full, due to pacman cache...

Can anyone give some help or tips? I thought of the solution of running some liveCD and resizing the partitions from the liveCD, but I prefer finding a solution with out liveCD.

Thanks,
jocom

Offline

#2 2010-10-26 07:49:10

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Resizing /var, /tmp and swap partition

I wouldn't even consider doing this without a live cd, but each to their own, I guess. smile

ext4 supports online resizing, so it should be possible to do what you want. What exactly are you finding impossible? Are there any error messages that might give us more details regarding this alleged impossibility?

Offline

#3 2010-10-26 08:16:01

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: Resizing /var, /tmp and swap partition

jocom wrote:

my /var is nearly full, due to pacman cache.

4GB? Have you done

pacman -Sc

Anyway, I have never bothered with separate /var & /tmp partitions. Why do you have them?

Do you need a swap partition? Would a swap file suffice?

Offline

#4 2010-10-26 10:47:42

jocom
Member
Registered: 2009-04-29
Posts: 74

Re: Resizing /var, /tmp and swap partition

I indeed considered

pacman -Sc

So no my /var uses 2.5GB. Still I would like to size it up.

Concerning the swap partition, I managed to resize it, so that one is done.

tomk wrote:

ext4 supports online resizing

I would be very glad to learn how to do that. Google didn't give me answers. (Which probably means I gave it a wrong query.)

Offline

#5 2010-10-26 11:03:47

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Resizing /var, /tmp and swap partition

man resize2fs

Offline

#6 2010-10-26 11:08:17

jocom
Member
Registered: 2009-04-29
Posts: 74

Re: Resizing /var, /tmp and swap partition

tomk wrote:

man resize2fs

Yes, but I read

man resize2fs wrote:

...The resize2fs program does not manipulate the size of partitions. If you wish to enlarge a filesystem, you must first make sure you can expand the size of the underlying partition first.

...

and thought it wasn't exactly what I was looking for. Because I need to expand the size of the partition too.

But, thanks for helping.

Offline

#7 2010-10-26 12:26:13

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Resizing /var, /tmp and swap partition


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#8 2010-10-26 12:27:22

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Resizing /var, /tmp and swap partition

Yeah, resize2fs just deals with the filesystem - if you're running it, it is assumed that you have already arranged your partitions as required.

You can deal with your partitions separately, again without a live cd, by booting into single user and running cfdisk, making sure that the affected partitions are not mounted first of course. Then run resize2fs.

Now you're going to say "well what's the point of supporting online resizing then, if I have to go offline first anyway?" smile - and my answer is "you should have just used an appropriate live cd in the first place". tongue

The more serious answer is that the devs of e2fsprogs and cfdisk work on their own tools, each of which does the intended job well, in line with existing unix tradition. It is up to others e.g. the gparted devs, and others of similar intention, to design ways of combining these tools to do the job that they (and you) want.

Offline

#9 2010-10-26 13:20:28

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Resizing /var, /tmp and swap partition

Reinstall your system and set up your partitions using LVM2.

You'll never look back. I promise.

Offline

Board footer

Powered by FluxBB