LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-24-2005, 08:44 PM   #1
browser
Member
 
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269

Rep: Reputation: 30
Resizing Linux Partition


I know I can resize a Windows Partition as I have done it successfully before but now I need to know if anyone knows or has had any problems trying to resize say a "/home" partition to make way for a extra distro to go on harddrive?
I have a harddrive with a /root partion & a Very Large /home partition which I would like to make smaller so I can add another distro.
 
Old 08-24-2005, 10:33 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
This is how I resize patitions.

1) make a backup of the partition you want to resize. you may need to restore it to make that distro bootable again.

2) open a term window and issue the command: init S or init 1 (to go to single user mode: I hope you are comfortable with command-line operations).

3) run cfdisk (probably /sbin/cfdisk: use locate to find it on your distro) to reduce the size of the partition you want smaller, and to create the new partition to take up the space you made available. BE CAREFUL. If you want the new partition/distro to be bootable, you will have to select the Bootable option for the new partition.

4) install the new distro to the new partition. Don't install the bootloader to the MBR, unless you feel competant to edit the bootloadeder config file manually to boot other distros. Install the bootloader to the partition the new distro in installed into, then edit the bootloader config file for the previous distro to add the new distro to it (copy the bootloader config for the new distro to the bootloader config of the existing distro).
 
Old 08-25-2005, 08:31 PM   #3
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
You could try installing qtparted - its a GUI which makes it all a bit more user friendly. However my personal favourite is to boot the machine with either a Mandrake/Mandriva install disk or a PCLinuxOS LiveCD and use the excellent Mandrake GUI partitioing program (its in the PCLinuxOS Control Centre on PCLinuxOS) to do it.
 
Old 08-26-2005, 09:01 AM   #4
sam.pedraglio
Member
 
Registered: Jul 2005
Distribution: Mint 14 64bit
Posts: 71

Rep: Reputation: 16
yuo could boot with a live distro like Knoppix and then use the Qtparted sw.
In this way you don't need to reinstall anything.
 
Old 08-26-2005, 06:17 PM   #5
browser
Member
 
Registered: Aug 2004
Location: Australia,NSW
Distribution: CalculateLinux, FreeBSD, Makulu, OpenSuse
Posts: 269

Original Poster
Rep: Reputation: 30
Excellent Ideas. I have all the Live distros mentioned ,But I dont think you can resize Linux Patritions with Qtparted only windows ,witch is why I asked about resizing linux, I think BigRigDrivers advice seems to have some basis to it,
I could also be wrong somewhere about qtparted though?
I might research into all this a bit more
Thanks 4 Helping.
 
Old 08-26-2005, 08:55 PM   #6
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I haven't used QTparted. But (and this is a very large but) if it inhereted the limitation of parted, I wouldn't try it. The limitation? Parted requires that the partition which is "The Object" must, MUST, be the same size as "The Target" partition in order to successfully restore a backup.

So. To solve that problem, I use DAR. I searched for four years for a backup solution to do what I wanted it to do (ignoring DAR all along the way). Late last year, I finally looked at DAR.

Damn. Here's what I've been looking for all along. DAR makes archives (each file individually archived, so that if one is corrupt, you risk only one, not the entire archive, as with tar).

DAR also has a skip-ahead feature. If a file, such as a data file (text, spreadsheet, etc) is corrupt, you can restore the non-corrupt part, and re-build the corrupt from other data sources [you still have them, don't you?])

Best part of DAR, vis-a-vis the current topic, is that DAR doesn't care one whit about partition sizes, so long as the target partition is large enough to hold the backup when it is restored.

Files can be compressed 'by extension', or selected for non-compression (because they're already compressed). I've successfully backed up a 6.6 G installation to a 2.7 G archive (the compression is just a little short of 3:1). Can't image life in the Linux world without DAR, unless something better comes along.

There's also KDAR, the Kde port. Haven't tried it yet. DAR is command line. KDAR is GUI.

'nuf said.

Last edited by bigrigdriver; 08-26-2005 at 09:00 PM.
 
Old 08-26-2005, 10:39 PM   #7
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Parted says it can resize ext2/ext3 and Reiserfs partitions, although QTparted claims it can't resize ext2/ext3 (may be outdated). Gparted seems to support more than either of these.
 
Old 08-26-2005, 11:25 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,129

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Make sure you have a *GOOD* backup - no, *2* good backups.
Parted is open source, and supposedly supports ext2(/3) - I've never got it to work.

Given that both qtparted and gparted rely on libparted, I've never bothered to try either, although others swear gparted works as advertised.
Me, I just backup everything, delete and recreate the partition(s) as I want, make the filesystem and reload.
Takes longer, but it's my data I'm looking after.

Last edited by syg00; 08-27-2005 at 12:58 AM.
 
Old 08-27-2005, 10:35 AM   #9
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
GParted is a _perfect_ GUI tool.
Mandriva's tool is also good.
You can resize it manually with "resize2fs" for ext2/3 and "fdisk".
I've done manual resizing _many_ times without any failure

Last edited by kornerr; 08-27-2005 at 10:36 AM.
 
Old 08-27-2005, 07:25 PM   #10
MTT1k
Member
 
Registered: Jul 2005
Location: Bulgaria [Sofia city], bukston city[neighbourhood]
Distribution: Linux Slackware 10.2 [k 2.6.12.6]
Posts: 41

Rep: Reputation: 15
I Have /dev/hda1 and it is too small
i have /dev/hda2 that is swap
and /dev/hda3 that is 30GB

I Want to get 1GB from hda3 and put it to hda1

Gparted & qtparted doesn´t allow me to Resize.

The button is inactive. What i must do ?
 
Old 08-27-2005, 08:33 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,129

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
hda1 can't grow if hda2 abuts it - as it probably does.
Easiest probably to delete the swap, grow hda1, and put a small swap back. This keeps fstab correct - if you need more swap, create another in space freed from hda3, and add it to fstab.
Logical partitions make this (slightly) easier - LVM looks the best solution of all.
 
Old 08-28-2005, 02:09 AM   #12
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
I'd do:
resize hda3 to half a size;
create hda4 from appered free space;
copy all file from hda3 to hda4;
since hda1 is root (I assume) you can delete it (because my root contains only files from Install CD);
delete also hda2 and hda3;
now you create swap at the beginning (~400M);
then you create root (no more than 3-4G);
then you create hda3 and copy all files from hda4 to it;
then you delete hda4 and resize hda3 to the end of the disk.

I have ~4G for root and ~27G for /home. So here is what I do:
I create /home/local and link it to /usr/local.
So now when I install an app it installs to /usr/local (i.e. /home/local) and doesn't take valuable root space, but takes space from the biggest partition.

You can do it either manually or using some Live CD.
 
Old 09-01-2005, 12:47 PM   #13
MTT1k
Member
 
Registered: Jul 2005
Location: Bulgaria [Sofia city], bukston city[neighbourhood]
Distribution: Linux Slackware 10.2 [k 2.6.12.6]
Posts: 41

Rep: Reputation: 15
Thank you

You've Gave me great ideas ;]
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Resizing Linux Partition From Partition magic John_Emad SUSE / openSUSE 5 02-16-2005 12:42 PM
resizing a partition in linux Snerkel Linux - Software 5 10-05-2004 04:42 PM
Resizing linux partition saiz66 Linux - Newbie 1 09-16-2004 08:05 PM
resizing the linux partition tzvik Linux - Software 2 04-30-2003 05:53 AM
Resizing linux partition tanchu Linux - Hardware 1 03-16-2003 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:22 AM.

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