# solved: swap on swap_partition - Invalid argument

## ntrl

Hi All!

```

gate etc # fdisk -l /dev/sda

Disk /dev/sda: 80.0 GB, 80025280000 bytes

255 heads, 63 sectors/track, 9729 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        1217     9775521   fd  Linux raid autodetect

/dev/sda2            1218        1342     1004062+  fd  Linux raid autodetect

/dev/sda3            1343        1405      506047+  82  Linux swap / Solaris

/dev/sda4            1406        9729    66862530   fd  Linux raid autodetect

gate etc # mkswap /dev/sda3

Setting up swapspace version 1, size = 518184 kB

no label, UUID=12218969-4d7c-4b29-be55-c0dd1e557fe9

gate etc # swapon /dev/sda3

swapon: /dev/sda3: Invalid argument

```

This not working.   :Sad: 

But this work:

```

gate etc # ls -la /var/pagefile.sys 

-rw-r--r-- 1 root root 524288000 Mar  9 05:42 /var/pagefile.sys

gate etc # mkswap /var/pagefile.sys

Setting up swapspace version 1, size = 524283 kB

no label, UUID=450a6f58-3845-4d66-b2d1-ac7b9f56bccd

gate etc # swapon /var/pagefile.sys

gate etc # free

             total       used       free     shared    buffers     cached

Mem:       1027648    1009080      18568          0      97488     662044

-/+ buffers/cache:     249548     778100

Swap:       511992          0     511992

```

I tried delete and create partition /dev/sda3, but this don't help.

gate etc # uname -a

Linux gate 2.6.23-gentoo-r9 #1 SMP Fri Mar 7 21:34:40 MSK 2008 i686 Intel(R) Core(TM)2 Duo CPU     E4600  @ 2.40GHz GenuineIntel GNU/Linux

----------

## HeissFuss

Are there any errors in dmesg or /var/log/messages related to this?

----------

## ntrl

```

gate asound # mkswap /dev/sda3 ; swapon /dev/sda3 ; dmesg | tail -5 

Setting up swapspace version 1, size = 518184 kB

no label, UUID=0296b4b9-e172-44ff-8292-6a223046ad1d

swapon: /dev/sda3: Invalid argument

PPP generic driver version 2.4.2

PPP MPPE Compression module registered

r8169: eth0: link down

Adding 511992k swap on /var/pagefile.sys.  Priority:-1 extents:142 across:533772k

Adding 511992k swap on /var/pagefile.sys.  Priority:-2 extents:142 across:533772k

```

I.e. nothing

I tried mkfs on this partiotion, but system apparently in use by the system

```

gate postfix # mke2fs /dev/sda3

mke2fs 1.39 (29-May-2006)

/dev/sda3 is apparently in use by the system; will not make a filesystem here!

```

What is it? Who lock this partition?

----------

## gerard27

What is in /etc/fstab and in

/etc/mtab?

Gerard.

----------

## ntrl

```

gate / # cat /etc/fstab  | grep -v '#'

/dev/md1      /      ext3      noatime      0 1

/dev/md3      /mnt/disk0   ext3      noatime      0 1

/dev/md4                /var            ext3            noatime         0 1

/pagefile.sys      none      swap      sw      0 0

shm         /dev/shm   tmpfs      nodev,nosuid,noexec   0 0

gate / # cat /etc/mtab 

/dev/md/1 / ext3 rw,noatime 0 0

proc /proc proc rw,nosuid,nodev,noexec 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec 0 0

udev /dev tmpfs rw,nosuid 0 0

devpts /dev/pts devpts rw,nosuid,noexec 0 0

/dev/md3 /mnt/disk0 ext3 rw,noatime 0 0

/dev/md/4 /var ext3 rw,noatime 0 0

shm /dev/shm tmpfs rw,noexec,nosuid,nodev 0 0

usbfs /proc/bus/usb usbfs rw,noexec,nosuid,devmode=0664,devgid=85 0 0

```

----------

## gerard27

What kind of install/distro are we talking about?

You seem to have setup swap as a file.

Apparently you didn't follow the Gentoo Handbook.

I can't help you with this kind of setup.

Gerard.

----------

## ntrl

Solved.

I fault and assem /dev/md3 with /dev/sda3 and /dev/sdb3.

But mkswap work on this partitions. 

I stop array and delete this disks.

After i assemble array with correct disks /dev/sda2 /dev/sda3.

mkswap on /dev/sda3

and plug swap swapon /dev/sda3.

All work perfect.   :Smile: 

All tanks!

----------

