LinuxQuestions.org
Help answer threads with 0 replies.
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 05-29-2003, 05:31 PM   #1
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Rep: Reputation: 30
SWAP Partition Emergency- Please Help!


Hi,

I was using parted to resize my partitions and I had to wipe my swap partition. Can someone help me to recreate it? Thank you!
 
Old 05-29-2003, 05:41 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Had to wipe it? While I dont think you have to have a swap partition, your current setup might not like it. Why not restore your partitions, and plan how you're going to split your drive in future?
Use parted again?
 
Old 05-29-2003, 06:04 PM   #3
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Umm,

I don't think I can do that as it's already been done. Any other ideas?
 
Old 05-29-2003, 10:15 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
As root do the following.
Create a partition using fdisk, cfdisk etc of the size desired.

Change its filetype to swap.

mkswap -c -v1 /dev/hdxy (use actual drive partition id for x & y)

Edit /etc/fstab to change partition ID of swap file

swapon /dev/hdxy
 
Old 05-30-2003, 01:07 PM   #5
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Okay, here is what is happening:

I go into FDISK and type exactly as follows:

:fdisk /dev/hda
:The number of cylinders for this disk is set to 9732.
:There is nothing wrong with that, but this is larger than 1024,
:and could in certain setups cause problems with:
:1) software that runs at boot time (e.g., old versions of LILO)
:2) booting and partitioning software from other OSs
: (e.g., DOS FDISK, OS/2 FDISK)
:
Okay, I created an extended partition here that was 512 MB large.
Then, I tried to change the flag type to swap and it won't let me. It says I have to delete the partition first.

So, next what I tried to do is go into parted and do it that way. However, this isn't working either. This is what I have so far. . .

Minor Start End Type Filesystem Flags
1 0.031 4000.561 primary ntfs
2 4000.562 4102.536 primary ext3 boot
3 4102.537 14998.183 primary ext3
4 14998.184 15508.059 extended lba

What I am attempting to do is change the flag on the lba to a swap and it doesn't not keep the changes. Any ideas?

Last edited by scottpioso; 05-30-2003 at 01:19 PM.
 
Old 05-30-2003, 01:41 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
Nope, except delete the extended partition and create a primary with swap filesystem type.
 
Old 05-30-2003, 02:15 PM   #7
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Thanks, I got it.

But one more question, what do I need to change in /etc/fstab? I've included it here.

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

Thanks.

Last edited by scottpioso; 05-30-2003 at 02:45 PM.
 
Old 05-30-2003, 03:51 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
/dev/hdxy swap swap defaults 0 0

Where x is the drive ID letter and y is the partition ID #
 
Old 05-30-2003, 04:05 PM   #9
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Okay, check this out. I put in that argument and when I boot up, I get an "invalid argument" error. I put it in verbatim as you said. . .

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda4 swap swap defaults 0 0
 
Old 05-30-2003, 05:52 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
I'm using Mandrake but I wouldn't think it would be different on RH.
 
Old 05-30-2003, 06:55 PM   #11
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Well, I don't know because I took that line out and it boots up fine. Does anyone else have any 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
swap-files after emergency exit? ungua SUSE / openSUSE 8 08-23-2005 01:58 PM
emergency, deleted linux partition by mistake snakeo2 Linux - Newbie 11 03-26-2004 06:40 AM
Can I have more than 1 Swap partition? Geeky_Kid Linux - Newbie 5 12-26-2003 01:26 AM
Change partition list, cant boot, emergency hydro Linux - General 3 07-25-2003 03:28 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 08:45 AM

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

All times are GMT -5. The time now is 08:25 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