LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   need bigger swap partition but missing a valid partition table (https://www.linuxquestions.org/questions/linux-hardware-18/need-bigger-swap-partition-but-missing-a-valid-partition-table-653066/)

compused 07-02-2008 08:22 AM

need bigger swap partition but missing a valid partition table
 
Hello there...does anyone know what steps can safely be followed to enlargen a swap partition, or for an alt. workaround here? The swap partition is 779 megs and 75% utilized but fdisk reports all partitions '[do] not contain a valid partition table'.

I have checked for redundant running processes, identified then killed these resulting in a decrease in swap partition usage to 50%, but its back at 75% usage now.

Here is an abbreviated command line output:
# fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 14496 116334697+ 83 Linux
/dev/sda3 14497 14593 779152+ 82 Linux swap



# fdisk -l /dev/sda2
Disk /dev/sda2: 119.1 GB, 119126730240 bytes
Disk /dev/sda2 doesn't contain a valid partition table



# fdisk -l /dev/sda3
Disk /dev/sda3: 797 MB, 797852160 bytes
Disk /dev/sda3 doesn't contain a valid partition table



# swapon -s
Filename Type Size Used Priority
/dev/sda3 partition 779144 582048 -1


Regards
Mike

syg00 07-02-2008 08:39 AM

i) - *don't* abbreviate output - that extra info is required.
ii) - fdisk works on block devices (your first example), not partitions.

Swapoff, enlarge the partition, or add another (swap) partition. If you have the space - we can't tell.

estabroo 07-02-2008 08:45 AM

fdisk is saying they don't have a valid partition table because they aren't supposed to have a valid partition table. You have probably already allocated your entire disk between those partitions. The easiest way to add swap at this point is to make a swap file. Use dd to create a file thats the size of how much swap you want to add, then run mkswap on that file, and use swapon to start using it.

Read the manpage for mkswap it describes this technique.

dd if=/dev/zero of=swap_file bs=1M count=100 (make a 100MB swap file)
mkswap swap_file
swapon swap_file

compused 07-02-2008 08:46 AM

Thanks....could someone give me the commands to enlargen the swap partition (safely)?

Regards again
Mike
(edit...was posted before the 2nd reply)


All times are GMT -5. The time now is 12:50 AM.