You are not logged in.

#1 2005-05-27 16:02:28

Cheikh
Member
Registered: 2005-02-07
Posts: 25

Resize Partition

I am planning to upgrade memory from 128 to 384 MB.  When I installed archlinux I  chosed autoconfigure, so now can someone explain me step by step how to resize my swap partition.  For live Cds I have Knoppix 3.6 and Pro Mepis beta 2 and which tool is best for the job.
My partition table looks like the following

Disk /dev/hda: 20.0 GB, 20020396032 bytes
16 heads, 63 sectors/track, 38792 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          66       33263+  83  Linux
/dev/hda2              67         587      262584   82  Linux swap / Solaris
/dev/hda3             588       38792    19255320   83  Linux

Thanks Cheikh

Offline

#2 2005-05-28 23:31:35

ravster
Member
From: Queen's U, Kingston, Canada
Registered: 2004-05-02
Posts: 285
Website

Re: Resize Partition

I use 'parted'. It is in the repos. If you use reiserfs you might need to install 'libreiserfs'.
The reason I like parted is that it defines everything in no. of MBs from the beginning of the disk. This way you just calculate how big you want the partitions and not bother about blocks and whatever else filesystems use (personally, I don't know anything about them).
I don't know which liveCD will have partitioning software, though, I've just used parted since ever. I saw a thread the other day about a gui tool for partitioning (can't find the thread right now).

Offline

#3 2005-05-28 23:43:05

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Resize Partition

just using cfdisk and the appropriate filesystem resize tools should be enough. In case of swap just do mkswap, others may need resizing with things like resize2fs, resize_reiserfs, etc.

Offline

#4 2005-05-29 07:51:11

CyberTron
Member
From: Gotland ,Sweden
Registered: 2005-03-17
Posts: 645
Website

Re: Resize Partition

Since i am used to partition magic I have used QTparted, which is a gui for parted..or cfdisk/fdisk

http://qtparted.sourceforge.net/


http://www.linuxportalen.com  -> Linux Help portal for Linux and ArchLinux (in swedish)

Dell Inspiron 8500
Kernel 2.6.14-archck1  (selfcompiled)
Enlightenment 17

Offline

#5 2005-05-29 10:12:43

T-Dawg
Forum Fellow
From: Wilmington, NC
Registered: 2005-01-29
Posts: 2,734

Re: Resize Partition

Yes, and last I knew, qtparted was on the arch livecd.

Offline

#6 2005-05-29 14:12:39

jw
Member
Registered: 2005-01-08
Posts: 88

Re: Resize Partition

One warning about QtParted:
I once managed to screw up my Reiserfs partition completely trying to do a Move/Resize. I think resizing should not be a problem, but you have make sure the start position of the partition does not change.

YMMV, of course.

Offline

#7 2005-05-29 17:45:10

Cheikh
Member
Registered: 2005-02-07
Posts: 25

Re: Resize Partition

Ok things happen I have Knoppix 3.6 it comes with qtparted also arch has qtparted I think that resizing my swap to a bigger size will put me in a position where i will have to resize everything else. OK but one thing I noticed after trying qtparted with Knoppix 3.6 I notice now that my file system is read only now, and it did not resize anything and now when booting i get so many warning messages and X wont start anymore. One of the first error is mount cant find /etc/fstab /in/ /etc/fstab or /etc/mtab

Offline

#8 2005-05-29 18:19:39

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Resize Partition

Cheikh wrote:

I think that resizing my swap to a bigger size will put me in a position where i will have to resize everything else.

You added more ram, so I thought you wanted less swap, why the hell would you want to make the swap partition bigger? (Do not think that swap should be twice as big as your ram, that isn't true for years.)

As for your problems: I don't trust parted, don't know what you or it did, so no idea what's wrong or how to fix it.

Offline

#9 2005-05-29 19:05:16

T-Dawg
Forum Fellow
From: Wilmington, NC
Registered: 2005-01-29
Posts: 2,734

Re: Resize Partition

i3839 wrote:

(Do not think that swap should be twice as big as your ram, that isn't true for years.)

Thats how I've always understood it. I spent alot time googling for the correct swap size before installing arch and that was the common answer that always showed up (unless ram is larger than 1GB).
How big should it be?

Offline

#10 2005-05-29 19:44:27

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Resize Partition

Depends on how much ram you have and what you do. I have 256 Mb ram and 141 Mb swap, but it is almost never used, so could as wel have 32 Mb. If too much swap is used then the machine will be unbearable slow anyway, so can as well just let the OOM killer kill the bloatware.

With the 2.6 kernel swapfiles should be as fast as seperate swap partitions, so nowaday I wouldn't make one at all, but just use a swapfile:

$ dd if=/dev/zero of=/mnt/swap bs=1M count=128
$ mkswap /mnt/swap
$ su
# echo "/mnt/swap swap swap defaults" >> /etc/fstab
# swapon -a

Then later if it turns out that it's not enough you simply make the file bigger, or add another one.

Offline

#11 2005-06-01 03:17:00

Cheikh
Member
Registered: 2005-02-07
Posts: 25

Re: Resize Partition

Now I know that swap is not supposed to be twice the size of ram.  Is it possible to use swap and swap file?

Cheikh

Offline

#12 2005-06-01 12:00:30

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Resize Partition

Yes, you can use both a swap partition and a swapfile at the same time.

Offline

Board footer

Powered by FluxBB