Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory missing monitor motherboard network printer problem ram registry router security slow software sound svchost.exe trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Chopping swap.

Reply  
Thread Tools
Whiteskin's Avatar
Senior Member with 2,051 posts.
 
Join Date: Nov 2002
Location: Alberta, Canada
Experience: Windows: Decent. Unix/Linux: Advanced +1
11-Aug-2004, 02:32 PM #1
Chopping swap.
Ok, this is frustrating. To start, I'lll just give a rundown of my drive, as it is now.

hda1 /boot
hda2 /home
hda3 swap
hda4 /

(Don't ask how that happened. It's a combination of saving old data, and not being used to the gentoo install)

Anyhow, I realize now that I made my swap partition much too big (Well, not as big as some have, but I digress). I'd like to cut it in half, and use the 300mb left over as a media partition where I can tote around songs/videos etc.

The problem is that If i use cfdisk (from my gentoo livecd), and delete hda3 and create either an extended or primary partition, smaller than the swap, the rest of the space is labled as "unusable". Fdisk is slightly better (or worse), as it lets me create an extended partition at the end of *gasp* one cylinder.

What is going on here, and how is this correctable?
__________________
emerge world_domination;
Smart Questions gentoo
Ubuntu
linux google:Shiny!
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
11-Aug-2004, 08:14 PM #2
hmm white I'm not sure ~_~; fdisk is the way to do it but it only creates a 1 cylinder extended partition? You should be able to chose if you want it at the beginning or at the end? Have you tried it at both and seen if it still is only one cylinder? If so I'm not sure if there's a way to get around it without doing a reformat since moving your / to hda3 would wipe it...

If you need to reformat ~_~ you might want to think about doing a
hda1 /boot (tiny)
hda2 /home (whatever you need)
hda3 / (small to big depending on what you want for it)
hda4 extended
hda5 /usr (fairly big since this is where portage is)
hda6 swap (your nice small swap)

I you notice as well there's been a lot of talk about not needing swap any longer in linux....so that's something to consider as well
__________________
Gentoo Developer, and 64bit os user

"In feeding Mother Nature, you are fed in return" - Tsunam (2005). Concerning water conservation, and raising water tables.
Whiteskin's Avatar
Senior Member with 2,051 posts.
 
Join Date: Nov 2002
Location: Alberta, Canada
Experience: Windows: Decent. Unix/Linux: Advanced +1
12-Aug-2004, 12:31 PM #3
Oh I need swap on this box... 64mb of ram. Sure, I might say I didn't need swap if i had 512.

I Don't know. I think the problem is that the partition is in the middle of two other primary partitions. So,A reinstall may be the only way to reclaim that space. Oh well, not right now.
__________________
emerge world_domination;
Smart Questions gentoo
Ubuntu
linux google:Shiny!
saikee's Avatar
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
13-Aug-2004, 10:40 AM #4
Your problem is pretty clear to me.

All hard disks can have only 4 primary partitions hda1 to 4.

If you want more partitions then one of the primary must be turned into an extended partition, which cannot be created in Linux but gives birth automatically whenever a logical partition is created. Only one extended partition is permitted. If you have two extended partitions it would be a mistake because the DOS-based partition table will not be able to find both.

Linux starts the first logical partition always as hda5.

There is no possibility for you to delete a primary, recreate another primary of smaller in size and use the space left over because there is no extended partition in your system. The left-over space in the hard disk can not be addressed because it is outside the partition table capability of a hard disk used for a PC.

You should be able to delete hda3, create a logical partition, which will immediately take up the hda5 designation, for swap and using the remaining space for another 20 logical partitions if you want. The catch is your Linux kernel will be lost as it can't find hda3. The hda3 exists only in name only as an extended partition that you haven't created but came into being the moment a logical partition is ordered by you. The extended partition is a box only encircling all your logical partitions or physically marking the boundary between the end of your hda2 and the beginning of hda4. The logical partition has a reduced partition table inside pointing to hard disk location of its next logical partition in the consecutive chain. Thus we can,t have a break in the extended partition or to redirect it the unused space in the hard disk.

I haven't done it myself but it may be possible for you to amend the boot menu file, fstab and mtab files to tell the kernel the swap is now hda5 instead of hda3, to keep your Linux going.
Whiteskin's Avatar
Senior Member with 2,051 posts.
 
Join Date: Nov 2002
Location: Alberta, Canada
Experience: Windows: Decent. Unix/Linux: Advanced +1
13-Aug-2004, 12:49 PM #5
Perhaps... I think next time though, I'll do a complete wipe. But this is fine for now. During a recent emerge I broke my swap usage record. Perhaps one day I'll actually use a large chunk of swap.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:16 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.