Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)
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)
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
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
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.
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?
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
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
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)
# 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"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.