I've tried to create a Linux swap file, but when I run fdisk, it looks like this: Device Boot Start End Blocks Id System /dev/hdb1 * 1 3644 29270398+ 83 Linux /dev/hdb2 3645 3737 747022+ f W95 Ext'd (LBA) /dev/hdb5 3645 3737 746991 82 Linux swap
Why is this W95 partition existing in the same place as my Linux swap? I would have thought they'd be incompatible. Can my Linux OS use this Linux swap?
Does this need cleaning up, and if so how?
Dave
On Thu, Sep 08, 2005 at 10:32:10PM +0900, Dave Gutteridge enlightened us:
I've tried to create a Linux swap file, but when I run fdisk, it looks like this: Device Boot Start End Blocks Id System /dev/hdb1 * 1 3644 29270398+ 83 Linux /dev/hdb2 3645 3737 747022+ f W95 Ext'd (LBA) /dev/hdb5 3645 3737 746991 82 Linux swap
Why is this W95 partition existing in the same place as my Linux swap? I would have thought they'd be incompatible. Can my Linux OS use this Linux swap?
Does this need cleaning up, and if so how?
It looks like it is some sort of extended partition. DOS disklabels can only have 4 partitions (primary), so to get around that you can create a primary partition as type extended, which can contain more partitions (up to 12, I think).
On my system, the extended partition is type 5, on yours it's type f. I'm not sure it's hurting anything, but to be on the safe side, I'd probably delete partitions 5 and 2, and just create a primary partition of type 82 (Linux swap).
In a related note, does your system have no other swap enabled at all? That could explain your yum-lockup problems. Yum is very memory intensive, if you starve it and it has no swap to go to, it probably will lock up. :-)
Matt
On Thu, 2005-09-08 at 22:32 +0900, Dave Gutteridge wrote:
I've tried to create a Linux swap file, but when I run fdisk, it looks like this: Device Boot Start End Blocks Id System /dev/hdb1 * 1 3644 29270398+ 83 Linux /dev/hdb2 3645 3737 747022+ f W95 Ext'd (LBA) /dev/hdb5 3645 3737 746991 82 Linux swap
Why is this W95 partition existing in the same place as my Linux swap? I would have thought they'd be incompatible. Can my Linux OS use this Linux swap?
That's an extended partition. It acts as a container for logical partitions (with a number greater than or equal to 5).
Thank you for the advice. With a little tweaking, my partitions now look like this: Device Boot Start End Blocks Id System /dev/hdb1 * 1 3644 29270398+ 83 Linux /dev/hdb2 3645 3737 747022+ 82 Linux swap
Will Linux automatically start using that as a swap, or do I have to do something to mount it or in any way initiate it's use?
Dave
On Thu, 2005-09-08 at 22:59 +0900, Dave Gutteridge wrote:
Thank you for the advice. With a little tweaking, my partitions now look like this: Device Boot Start End Blocks Id System /dev/hdb1 * 1 3644 29270398+ 83 Linux /dev/hdb2 3645 3737 747022+ 82 Linux swap Will Linux automatically start using that as a swap, or do I have to do something to mount it or in any way initiate it's use?
mkswap /dev/hdb2 swapon /dev/hdb2
And add this to your /etc/fstab: /dev/hdb2 swap swap defaults 0 0
-- Bryan
P.S. I hope /dev/hdb2 isn't a slave ATA device? Or is it an SATA device?
mkswap /dev/hdb2
I didn't even get to the second command you mentioned: [root@localhost ~]# mkswap /dev/hdb2 mkswap: error: swap area needs to be at least 40kB Usage: mkswap [-c] [-v0|-v1] [-pPAGESZ] /dev/name [blocks]
That's weird. I thought my swap partition was 747022+ blocks, which, not knowing what a block is, sounds like a lot more than 40kB.
swapon /dev/hdb2
And add this to your /etc/fstab: /dev/hdb2 swap swap defaults 0 0
I did that. I noticed in my fstab file that there is also this: /dev/VolGroup00/LogVol01 swap swap defaults 0 0 ... That's not going to cause any conflicts or anything, is it?
P.S. I hope /dev/hdb2 isn't a slave ATA device? Or is it an SATA device?
I don't know. /dev/hdb2 is another partition on the same hard drive that my Linux installation is on. Does that answer the question? Are you hoping it's not a slave because if it is a slave, my computer will explode sending fiery shrapnel of death directly into my brain?
Dave
I realized what went wrong with the earlier commands. If I do fdisk, it looks like this: Device Boot Start End Blocks Id System /dev/hdb1 * 1 3644 29270398+ 83 Linux /dev/hdb2 3645 3737 747022+ f W95 Ext'd (LBA) /dev/hdb5 3645 3737 746991 82 Linux swap
I don't understand why it still says W95 Ext there, as I thought I deleted that. But anyway, it seems my swap is on hdb5, not hdb2. If I run the following commands:
mkswap /dev/hdb5 swapon /dev/hdb5
And add this to your /etc/fstab: /dev/hdb5 swap swap defaults 0 0
then it works.
I hope it's okay to run it this way.
Dave
On Sat, Sep 10, 2005 at 01:12:17AM +0900, Dave Gutteridge enlightened us:
I realized what went wrong with the earlier commands. If I do fdisk, it looks like this: Device Boot Start End Blocks Id System /dev/hdb1 * 1 3644 29270398+ 83 Linux /dev/hdb2 3645 3737 747022+ f W95 Ext'd (LBA) /dev/hdb5 3645 3737 746991 82 Linux swap
I don't understand why it still says W95 Ext there, as I thought I deleted that. But anyway, it seems my swap is on hdb5, not hdb2. If I run the following commands:
mkswap /dev/hdb5 swapon /dev/hdb5
And add this to your /etc/fstab: /dev/hdb5 swap swap defaults 0 0
then it works.
I hope it's okay to run it this way.
Yeah, it doesn't make a big difference. I just noticed this morning another Linux machine I have that is using a type f (W95 Ext) extended partition instead of type 5. Since you only have 2 partitions, you don't need the extended partition, but it also isn't hurting anything.
If you run the "free" command, you should see something after Swap: that is greater than 0.
As I said before, it will probably help the lock-up situation if you didn't actually have any swap before.
Matt