LinuxQuestions.org
Help answer threads with 0 replies.
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 04-26-2004, 01:29 PM   #1
davoman
Member
 
Registered: Nov 2003
Location: New Zealand
Distribution: Ubuntu 6.10/7.04
Posts: 51

Rep: Reputation: 15
Talking Partition puzzle


Okay heres one for ya:
(bare in mind this all stems from me not understanding how to make a swap -file-)

Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3              3781448   3245688    340572  91% /
/dev/hda5              6144828   1762652   4382176  29% /mnt/ntfs
/dev/hda2              5403332   2457376   2945956  46% /fatso
/dev/hda4              4522380    424064   3868588  10% /home
There you see 4 primary partitions. /dev/hda4 is my home files partition with a few gigs free.

Presently I have no swap partition, and its teh sux. How can I claim some of the space of the /dev/hda4 partition and use it for a swap partition? (files are tar'd up on my FAT partition)

Removing /dev/hda4 and creating a smaller partition results in the remaining space being classed 'unusable'.

I understand one can have only 4 primary partitions. Help, help, and help again.
*NB How can I have these 10 million programs without a swap device set?

Last edited by davoman; 04-26-2004 at 01:30 PM.
 
Old 04-26-2004, 02:43 PM   #2
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Create a new directory on /fatso ?backup and then do cp -a /home /fatso/?backup. Then unmount and cfdisk /dev/hda4 create another /home partition and a swap partition from /dev/hda4 then format the new partition for home. Mount /dev/hda4 as /mnt and do cp -a /fatso/?backup /mnt. Edit your fstab to reflect the new swap partition and reboot.
 
Old 04-26-2004, 03:14 PM   #3
davoman
Member
 
Registered: Nov 2003
Location: New Zealand
Distribution: Ubuntu 6.10/7.04
Posts: 51

Original Poster
Rep: Reputation: 15
Sweet thanks for your help but....

Thats what I origionally tried. I backed up my home documents onto my FAT partition.

And when I deleted the hda4 partition in an attempted to create 2 smaller ones, I was only allowed to make 1, with the rest of the space marked 'unusable'.

Perhaps an 'extended' partion with 'logical drives'? Or is that only relevant for MSDOS?

Or what about making a swap file. How does one accomplish that?
 
Old 04-26-2004, 04:42 PM   #4
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
make a logical partition then make a swap partition in it.
 
Old 04-26-2004, 05:05 PM   #5
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Yes, you can set up the swap and ext3 partitions as logical partitions within an extended partition to keep the primary partition count down. I do this routinely with PartitionMagic, but I am sure there are linux routines that can do it for you (parted?), too.

Two points to remember:

(1) The linux ext3 partition will not boot when you convert it to a logical partition. The boot loader will be pointing to the old partition number, not the new one. You will need to update the boot loader to point to the right partition. If you use GRUB, make a GRUB command line boot disk beforehand, so that you can boot to GRUB command line and fix the problem. This problem is really easy to fix using the GRUB boot disk.

(2) If anyone is thinking about converting their preexisting swap and ext3 partitions to logical partitions, remember that you need to modify the /etc/fstab entry for the swap partition to point to the new partition number.
 
Old 04-26-2004, 06:29 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,865

Rep: Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739
Re: Partition puzzle

Quote:
Originally posted by davoman


Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3              3781448   3245688    340572  91% /
/dev/hda5              6144828   1762652   4382176  29% /mnt/ntfs
/dev/hda2              5403332   2457376   2945956  46% /fatso
/dev/hda4              4522380    424064   3868588  10% /home
There you see 4 primary partitions. /dev/hda4 is my home files partition with a few gigs free.

Removing /dev/hda4 and creating a smaller partition results in the remaining space being classed 'unusable'.

I understand one can have only 4 primary partitions. Help, help, and help again.
*NB How can I have these 10 million programs without a swap device set?
Any partition ID >=5 has to be a logical partition. Therefore, /dev/hda1 is your extended whcih is considered a primary and contains /dev/hda5. To see how the entire disk is formatted log in as root:
fdisk -l (thats a small L)

You are correct that you can only have 4 primaries and that resizing one will only leave you will space you can not use. To create additional partition you will need to resize the extended partition and then create another logical drive for swap.

Are you sure you do not have a swap partition? Take a look at the /etc/fstab file. swap partitions are not mounted like / and /home and not get displayed with the df command. Also look at the output of the free command. If total swap is greater then zero then you do indeed have swap space. And if you do have swap how much is being used.

If you do not have a swap partition you can create a swap file. If this speeds things up then you might want to consider resizing paritions etc. If not then you might want to look elsewhere.

http://www.justlinux.com/nhf/Filesys..._Swapping.html

If you think your PC is running slow how much RAM do you have. What desktop are you running i.e. KDE etc. What speed is your PC etc...
 
Old 04-26-2004, 07:22 PM   #7
driftingremains
LQ Newbie
 
Registered: Jul 2003
Location: Mass
Distribution: gentoo
Posts: 20

Rep: Reputation: 0
Linux is very tricky with partitions, I usually used partition magic for situations like that.
 
Old 04-26-2004, 08:35 PM   #8
davoman
Member
 
Registered: Nov 2003
Location: New Zealand
Distribution: Ubuntu 6.10/7.04
Posts: 51

Original Poster
Rep: Reputation: 15
Okay guys thanks for your help. You guys are teh ruelz.
I will download this 'parted' tool.

I will try this:

*Remove the hda4 partition.
*Create an extended partition with and 2 logical paritions inside it.

I haven't been able to do it with cfdisk so I'll reply again with my results.
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
GTK puzzle Chuck23 Fedora 9 08-24-2004 03:04 AM
Simple C Puzzle sansk Programming 20 05-22-2004 04:09 PM
Printer Puzzle seanmaggs LinuxQuestions.org Member Success Stories 0 03-30-2004 05:04 PM
A puzzle for you to figure out, I can't cpeppler Linux - Software 12 10-06-2003 12:37 PM
Multicasting puzzle tachyon273 Linux - Networking 0 03-14-2003 04:38 PM


All times are GMT -5. The time now is 12:15 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 Google+: linuxquestions
Open Source Consulting | Domain Registration