Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Need To Resize Ext3 Partition With Underlying One, underlying partition that is...
spiroth10
post Jul 29 2004, 11:11 PM
Post #1


Grub-er
**

Group: Members
Posts: 32
Joined: 21-February 04
Member No.: 2,431



yeah, I have redhat installed, and it all worked fine, until the small partition ran out of space that is. now nothing works correctly, and X wont start... I cant use it in console because my systems configure to suto start X, and theres no space anyway, so its useless to anyway.

I have an ext3 partition with an underlying partition for swap space, and 2 gigs free space I want to add. how can I add this??? can someone explain this to me? I dont want to reinstall linux, because I just got this configured the way I want... sad.gif

I didnt figure Id need space, but I installed a cross compiler for dreamcast and it was bigger than I thought it would be...

please help! I dont want to be stuck using windows ME for too long sad.gif
Go to the top of the page
 
+Quote Post
hughesjr
post Jul 30 2004, 05:25 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



You basically have 2 options. (3 if you include reinstall)

If you are lucky, and if your current partition ends where your unpartition space begins, you can just change the endpoint of the current partition.

Post the output of the command:

fdisk -l

Mine looks like this:

CODE
Myth ~ # fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14         263     2008125   82  Linux swap
/dev/hda3             264       14000   110342120   83  Linux


So I have a drive with 14593 cylinders ... and I am using 1 through 14000 ... which means that 14001 to 14593 are available to be assigned to a partition. If I wanted to assign that to /dev/hda3 it would be easy ... All I need to do is use fdisk, delete the current partition and create a new one that starts at 264 and ends at 14593.
[quote]Warning - you must start the new partition on the same cylinder where it initially started (in this case 264) or you will lose all data ... In fdisk, if you start at the same place and make a larger partition, you won't lose any data.[quote]

But if I wanted to use the 14001-14593 partition to extend /dev/hda1, I can't do that (at least not as an extention of the original partition).

What I could do is create a new partition (/dev/hda4) and the mount it and use it for storage. This is kind of tricky, and would go like this:

use fdisk and create a new partition named /dev/hda4 that starts at 14001 and ends at 14593 ... my fdisk -l now looks like this:

CODE
Myth ~ # fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14         263     2008125   82  Linux swap
/dev/hda3             264       14000   110342120   83  Linux
/dev/hda4          14001       14593      4755571   83  Linux


I can then make a filesystem on the new partition ... for ext3 it would be:

mke2fs -j /dev/hda4

When finished, I have a 4.7gb partition I can mount into my filesystem ... so I could make a place to temporarily mount the new partition ... like this:

mkdir /mnt/new

then mount it:

mount /dev/hda4 /mnt/new

Now, I have a 4.7 gb partition in /mnt/new.

(doesn't help us yet....)

Next, I need to pick a root level directory (/bin or /var are good bets) that is large, but not not bigger than 4.7 gb and copy to the new partition ... let's say that /var has 2gb of data ...

I would copy all the files (with dates/permissions intact) in /var to /mnt/new ... I would do it like this:

cd /var
find ./ -xdev -print0 | cpio -pa0V /mnt/new


Then verify they made it to /mnt/new. If all is there ... then you can unmount /mnt/new:

umount /mnt/new

then mount then remove the directory /var (cd /; rm -rf /var; mkdir /var; chmod 755 /var), the mount the new partition (that has all the /var stuff in it) as /var with the command:

mount /dev/hda4 /var

If everything is now working, you need to edit /etc/fstab to mount the new /var ... so I would add this line:

/dev/hda4 /var ext3 noatime 1 1

Now, if I do the command:

df -h

I see that /var has 2gb and 2.7gb free and the /root partiton has 2gb free (that was assuming that /var had 2gb of original data and the new partition was 4.7 gb).
----------------
It is really important to assign enough room at first ... for all new users, I recommend at least a 5-6gb partitin for your root linux partition (10gb is better).


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
adam.stokes
post Jul 30 2004, 09:41 PM
Post #3


./configure
***

Group: Members
Posts: 65
Joined: 22-July 04
From: raleigh, NC
Member No.: 3,403



Maybe ill write a lvm tutorial one day smile.gif


--------------------
adam.stokes
Fedora Core rawhide, RHEL WS, ES, AS :)
Red Hat Certified Engineer
Go to the top of the page
 
+Quote Post
hughesjr
post Jul 31 2004, 05:27 AM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



lvm (logical volume manager) is an option ... if the original partions were setup that way.

I use a lvm in HPUX ...


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 04:57 AM