LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-03-2004, 03:58 AM   #1
stingerbee
LQ Newbie
 
Registered: Feb 2004
Posts: 8

Rep: Reputation: 0
Partitioning after installation


hi

i dual boot between fedora core 2 and win xp pro and i think i have accidentally overwritten my linux swap file when creating a new fat32 partition in windows to share files between both operating systems. fedora still boots fine, but i'm guessing that it's not had to use the swap file yet as i've not used it since the swap file mistake accept to test that it still boots. anyway, my question is can you re-create a awap partition in linux with a disk druid sort of tool?

thanks

john

p.s.
is fat32 still the "standard" for sharing files between xp and linux? (if you want read/write access from both OS's)
 
Old 08-03-2004, 04:45 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
to your ps:

that would be the easiest way to go - if you do not need the features of NTFS in WinXP
you could have a separate partition with fat32 for sharing files...

If there is still room on your hd to make the swap-space its easy...

-create a partition with fdisk
-"format" it as swap: "mkswap /dev/hd??"
-tell linux to use it: swapon /dev/hd??
-and write the name and location to your /etc/fstab...

If you need to resize partitions to make room - there are some tools (linux and windows ones - parted being one of them)

please search the forums and the net on which one is easy and safe to use and how.

you could also solve that by using a swap-file instead - this is slower than having a swap-partition (at least has been - I heard that when using kernel-2.6.x there would not be a significant speed difference)
 
Old 08-03-2004, 05:07 AM   #3
stingerbee
LQ Newbie
 
Registered: Feb 2004
Posts: 8

Original Poster
Rep: Reputation: 0
hi jomen - thanks for the info it's very useful. i have one final question, i have fired up a terminal window and tried to run fdisk but it's not recognised. i thought it sounded like a default tool but it doesn't work - i haven't got the syntax wrong it just fails to find fdisk. id FDISK something that needs to be installed additionally? i am running fedora core 2

cheers
 
Old 08-03-2004, 06:02 AM   #4
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
since fdisk is a potentially dangerous tool it could be located in a directory which normally only root has in its default PATH... it could (not sure - try it while being careful!) also be only usable by root...

To find it, type "which fdisk" and thecommand should return the full PATH to where it is - you can eighter call it with this full PATH or become root and then try it...

It is most likely in /sbin ( /sbin/fdisk )

if you have more than one disk, you will need to give the name of the disk you want to see/modify

There is a more comfortable version to do the same job it is called "cfdisk" - but I'm not sure if it is installed in fedora - try!

try fdisk /dev/hda and then press p at the menu - it will list the partitions on your first hd
 
Old 08-03-2004, 06:05 AM   #5
stingerbee
LQ Newbie
 
Registered: Feb 2004
Posts: 8

Original Poster
Rep: Reputation: 0
i tried running it as root but it still failed. also tried cfdisk and that failed too! i'm sure i'll find it with the 'which fdisk' command though and then i can relocate to that dir and run it.

thanks for your help
 
Old 08-03-2004, 06:26 AM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
no need to relocate it - just call it with its full path and it will work - as I said - probably you have to be root to run it sucessfully.
 
Old 08-03-2004, 03:21 PM   #7
stingerbee
LQ Newbie
 
Registered: Feb 2004
Posts: 8

Original Poster
Rep: Reputation: 0
One last thing - I have followed the instructions by creating a new partition in fdisk, and then running mkswap etc... now, when i go in to fdisk and display the partition information, my new swap partition shows up as FAT16 - is this correct? is there anyway that I can verify in linux that my swap partition is in use?
 
Old 08-03-2004, 03:33 PM   #8
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
1. If your swap partition shows up as FAT16, it might confuse windows to think it may tamper with it. In fdisk, there is a command to change the type - t. Use it and change the type to 82 - Linux Swap.
2. less /proc/swaps
 
Old 08-03-2004, 04:06 PM   #9
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
No - this is not correct!

sorry - Ishould have said "create a swap-partition with fdisk" instead of "create a partition with fdisk" - I did not think of that - but fdisk is asking for the type of partition it is about to create - you just need ko know the code - which you get listed using "l" from the menu

note that I said: "If there is still room on your hd to make the swap-space its easy..."
please note the IF!

I do hope you did not delete a partition with an OS installed to it to make it a bit smaller to have room for the swap you wanted!

Using fdisk is not very convenient - use cfdisk instead - if you have it.

The filesystem-type of the partition you created should be 82 (for Linux Swap).
The code for fat16 is 6 - probably you where using fdisk incorrectly - try again!
It has a menu-system which lets you do what you want, but - as I said - not really convenient ( type "m" for what each option will do - to actually write everything you did (with/to the partition-table) to disk, you will have to issue "w" - but be sure that the layout you created is indeed what you wanted!

After creating your swap-partition comes the formatting step - I'm not sure if mkswap will actually succeed if you issue it to create swap-space on an fat16-type partition but i suppose that it should at least print a warning if you are going to do that (I have to be vague on this, because I will - for obvious reasons - not try it here on my machine to make sure and possibly mess things up)

to verivy - use "swapon -s" - it will show you which partition (and of which size...) is used as swap

you could also issue "top" and look in the header of the table, which is printed and updated every few seconds
 
Old 08-03-2004, 05:02 PM   #10
stingerbee
LQ Newbie
 
Registered: Feb 2004
Posts: 8

Original Poster
Rep: Reputation: 0
cool - almost there - no partitions replaced! all OS's intact!

what exactly needs to be specified in the line in the fstab file?

thanks
 
Old 08-04-2004, 06:55 PM   #11
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
"man fstab" will tell you all about it...

You have accidentally overwritten (I mean "deleted") your swap-partition - it was not there anymore - but before that you had one and it was in use by your system? Is this correct?
Now you (re)created one - I assume that is meant by your post...?

In that case - please read the file /etc/fstab - there has to be a line in there which tells the system where (on which device/partition) this swap-space is located.
If you had a swap-partition, the line will probably already be there - but maybe now pointing to the wrong location

This is how my /etc/fstab looks like: (I issued the command: "cat /etc/fstab" - which prints out the contents. You could use any editor to read it and write changes to it, if necessary)

Jonathan:~$ cat /etc/fstab

# Begin /etc/fstab

# filesystem mount-point fs-type options dump fsck-order


#das root-filesystem
/dev/hda2 / ext3 defaults 0 1


/dev/hda5 / swap pri=1 0 0

proc /proc proc defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
usbfs /proc/bus/usb usbfs defaults 0 0

#freie 40 GB Partition
/dev/hda6 /mnt/extra ext3 defaults 0 2


# Brenner
#/dev/scd1 /mnt/brenner auto ro,noauto,user,noexec,unhide 0 0
/dev/hdd /mnt/brenner auto ro,noauto,user,noexec,unhide 0 0

# DVD
#/dev/scd0 /mnt/dvd auto ro,noauto,user,noexec,unhide 0 0
/dev/hdc /mnt/dvd auto ro,noauto,user,noexec,unhide 0 0

/dev/fd0 /mnt/floppy auto rw,nodev,noexec,user,noauto 0 0





in there - /dev/hda5 is mentioned as being my swap-partition.

A line like this - just with the /dev/hda5 replaced by the name of the disk/partition your swap-partition has, would do the trick.
You might need to issue the command "swapon -a" to make it available to your running system.
You must have run "mkswap /dev/_your_swap_partition" to be able to do the "swapon -a"
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware installation: partitioning (help!) maxmax Slackware - Installation 2 09-26-2005 06:29 PM
Partitioning ideas for installation argarc Slackware 11 03-21-2005 11:21 AM
SUSE Installation Partitioning rob0t Linux - General 2 02-14-2005 03:36 PM
SUSE installation partitioning rob0t SUSE / openSUSE 3 02-13-2005 07:31 PM
Partitioning for installation trotsky Linux - Newbie 6 12-24-2004 04:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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