LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
LinkBack Search this Thread
Old 01-10-2004, 08:42 AM   #1
funkymunky
Member
 
Registered: Jun 2003
Location: Austin, Texas
Distribution: Fedora Core 8, 32-bit
Posts: 126

Rep: Reputation: 15
Unhappy resizing linux partitions with partition magic ??


hi!
i have a p4 1.8 ghz with 25 mb of ddr sdram.
i have a 40 gig HDD which is partitioned as follows:
one 20 gig primary partition
the remaining 20 gb constitute the extedned partition.out of this,13 gb is a DOS logical drive.
the remaining 7 gb are under linux (ext3)
that is further divided into a 500 mb swap partition and a 6.5 gb root partition
i hav run out of space on the root partition, now i want to expand it, taking space from the DOS logical partition.i have partition magic 8.0
my question is, will i hav to make any changes in any linux config file if i do it with partiton magic?? will linux recognise the new space added??
and, can i do the same with the swap partition?? i have 256 megs or ram, and people tell me a 500 mb swap partition is too small..is that right??
i tried using the fdisk program of linux, but it didnt work for me..so im sticking to partition magic

thanx in advance

Mayank
 
Old 01-10-2004, 10:12 AM   #2
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 446

Rep: Reputation: 32
Re: resizing linux partitions with partition magic ??

Quote:
Originally posted by funkymunky
hi!
i have a p4 1.8 ghz with 25 mb of ddr sdram.
i have a 40 gig HDD which is partitioned as follows:
one 20 gig primary partition
the remaining 20 gb constitute the extedned partition.out of this,13 gb is a DOS logical drive.
the remaining 7 gb are under linux (ext3)
that is further divided into a 500 mb swap partition and a 6.5 gb root partition
i hav run out of space on the root partition, now i want to expand it, taking space from the DOS logical partition.i have partition magic 8.0
my question is, will i hav to make any changes in any linux config file if i do it with partiton magic?? will linux recognise the new space added??
and, can i do the same with the swap partition?? i have 256 megs or ram, and people tell me a 500 mb swap partition is too small..is that right??
i tried using the fdisk program of linux, but it didnt work for me..so im sticking to partition magic

thanx in advance

Mayank
It looks like the 25 mB sdram is actually 256 mB. 500 mB swap is likely more than enough. Try the "free" to see your usage of RAM and swap.

Let me guess: you have added software and /usr has grown, or you have added web content and /var has grown.

A temporary fix is to delete any stuff you do not need. /var/log/ may contain old messages that you have been accumulating. /tmp may be plugging up too, on some systems.

If the DOS and / partitions are adjacent, it should be possible to move the border by modifying the partition table. If you have to split the DOS partition and add part to LINUX, this would require changing some configuration files. Typically, what you would do is modify /etc/fstab so that the new partition get mounted on /usr or /var or somewhere you have run out of space. There are several steps: repartitioning, setting up a Linux filesystem on the new partition, copying files from the old partition to the new, modifying /etc/fstab to show mounting the new partition on the old directory, deleteing the files that have been copied after verifying to free the space, and rebooting. I doubt partition magic will do anything as complicated as that for you, but you can do it yourself. First defragment the DOS partition. Then divide the partition. Use the later part for Linux.

Whether you fear this procedure, or are confident it will work for you, back up any important or valuable data before starting. The surest procedure for a newbie would be to repartition and re-install everything as required.

If you list your partition table in detail, we can be more specific with advice. It might be wise to list the table with fdisk in Linux and with fdisk in that other OS, to make sure everyone is happy in the end. Please show sector addresses and partition sizes and types. Indicate which partition is bootable. You wrote that fdisk did not work. What went wrong, exactly?
 
Old 01-10-2004, 11:39 AM   #3
funkymunky
Member
 
Registered: Jun 2003
Location: Austin, Texas
Distribution: Fedora Core 8, 32-bit
Posts: 126

Original Poster
Rep: Reputation: 15
well, thanx for the reply

the 25 mb is really 256

the system in question is not here right now, so "fdisk -l " is not possible

i can tell u though, that the dos and the root partitions are adjacent, and partition magic provides the option of resizing the root partition to take over some of the space of the adjacent dos partition...what im not sure abt it what effect it will have on linux...will some config files hav to be altered??

regards
Mayank
 
Old 01-10-2004, 11:43 AM   #4
funkymunky
Member
 
Registered: Jun 2003
Location: Austin, Texas
Distribution: Fedora Core 8, 32-bit
Posts: 126

Original Poster
Rep: Reputation: 15
PS...when i made changes with fdisk-i deleted the dos partition and made an ext3 partition in its place-no chnges occured, and when i rebooted in Windows, nothing had changed!
 
Old 01-10-2004, 06:36 PM   #5
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 446

Rep: Reputation: 32
Bravo! You might become a brain surgeon yet. You may have to create a file structure on the partition (PM may have done that). You can try manually mounting the retyped patition:
as root
mkdir /mnt/usr (if /usr is full)
mount /dev/hdawhatever /mnt/usr
To check.
If you need to put a filesystem on it:
mke2fs -j /dev/hdawhatever
The whatevers are the partition number according to Linux.

If this test works, you can copy what files you want into the retyped partition and remount it at boot by modifying /etc/fstab
/dev/hdawhatever /usr ext3 defaults 1 2

Supposing /usr is full, copy /usr over to the new area, and check every file for accuracy.
mkdir /mnt/usr
cp -R /usr/* /mnt/disk/usr
tar c /usr |md5sum -
cd /mnt/disk
tar c usr |md5sum -

The two md5sums should be the same...
If so, you can delete contents of /usr to release space.
cd /usr
rm -fr *
umount /dev/whateverr
mount /dev/whatever /usr
Your system should work normally except /usr is no longer crowded.

Now reboot (after changing /etc/fstab to mount the retyped partition as /usr).

One needs to be very careful doing commands like these as root. One little type could delete the wrong stuff!

Last edited by RobertP; 08-22-2007 at 02:57 AM.
 
Old 08-22-2007, 01:03 AM   #6
pvkiran
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
Question

Hi robert,

i need to resize my partitions in linux..

here are the details of present partitions..

[root@VPMUM1WEB01 root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 4.1G 2.4G 1.5G 63% /
none 2.0G 0 2.0G 0% /dev/shm
/dev/sda2 54G 976M 50G 2% /usr/local
/dev/sda3 7.9G 209M 7.3G 3% /var


[root@VPMUM1WEB01 root]# fdisk -l

Disk /dev/sda: 145.9 GB, 145999527936 bytes
255 heads, 63 sectors/track, 17750 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 534 4289323+ 83 Linux
/dev/sda2 535 7577 56572897+ 83 Linux
/dev/sda3 7578 8621 8385930 83 Linux
/dev/sda4 8622 8875 2040255 f Win95 Ext'd (LBA)
/dev/sda5 8622 8875 2040223+ 82 Linux swap


I want to make a separate partion of 60 or 70 GB... with the present structure..!!

please guide me what i want to doo.. as i ama not an linux expert..!!
 
Old 08-22-2007, 03:16 AM   #7
RobertP
Member
 
Registered: Jan 2004
Location: Manitoba, Canada
Distribution: Debian
Posts: 446

Rep: Reputation: 32
Quote:
Originally Posted by pvkiran View Post
Hi robert,

i need to resize my partitions in linux..

here are the details of present partitions..

[root@VPMUM1WEB01 root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 4.1G 2.4G 1.5G 63% /
none 2.0G 0 2.0G 0% /dev/shm
/dev/sda2 54G 976M 50G 2% /usr/local
/dev/sda3 7.9G 209M 7.3G 3% /var


[root@VPMUM1WEB01 root]# fdisk -l

Disk /dev/sda: 145.9 GB, 145999527936 bytes
255 heads, 63 sectors/track, 17750 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 534 4289323+ 83 Linux
/dev/sda2 535 7577 56572897+ 83 Linux
/dev/sda3 7578 8621 8385930 83 Linux
/dev/sda4 8622 8875 2040255 f Win95 Ext'd (LBA)
/dev/sda5 8622 8875 2040223+ 82 Linux swap


I want to make a separate partion of 60 or 70 GB... with the present structure..!!

please guide me what i want to doo.. as i ama not an linux expert..!!
The start/end information shows the partitions you have listed are contiguous so you should have a lot of free space from the end of /dev/sda5 to the end of disc.

For some purposes, fdisk is not the best partitioner. You may have cfdisk or sfdisk etc.

In fdisk, you would issue the "n" command to create a new partition and specify the length in units of cylinders or bytes. You can mark the partition type by typing l to list available types and t to mark the new partition's type. You probably want type 83 or Linux. When the partition table as listed by the p command looks right, write it to disc by the w command. Your changes have no effect until you do that. Supposing that your new partition is /dev/sda6, you could put that in your /etc/fstab:
/dev/sda6 /home jfs defaults 0 2
You will want to create a filesystem on the partition using mkfs.
mkfs -t jfs /dev/sda6

Just a reminder... A mistake with this stuff could be fatal. If you put the wrong partition in the mkfs command, you clobber the wrong partition. If you delete stuff from the partition table and then do a w, you lose that from the partition table. It is an excellent idea to save a copy of the partition table so you can get your data back by restoring it if necessary. Take a few moments before pushing enter. Make sure you have enough sleep and are not rushed...

On some systems the changed partition table may not have effect until you reboot. On others, exiting the fdisk programme re-reads the table.

Good luck.
 
  


Reply

Tags
resizing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Partition magic not letting me create partitions lance.story Linux - Newbie 1 07-17-2005 08:59 AM
Problem Resizing Linux Partition From Partition magic John_Emad Suse/Novell 5 02-16-2005 12:42 PM
Repartitioning / Resizing partitions: partition magic in linux: possible? hamish Linux - Newbie 6 06-07-2004 04:00 PM
Resizing Linux' partitions. naijin Linux - General 40 01-04-2004 03:33 PM
Partition Magic & converting to logical partitions lawsonrc Linux - General 2 10-28-2003 06:39 PM


All times are GMT -5. The time now is 07:56 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration