Loading ...
Sorry, an error occurred while loading the content.

cannot swapon /dev/sda2

Expand Messages
  • John Cole
    Hello, I ve followed the setup instructions for SlugOS 3.10 beta but I cannot get the swapon command to work. I get: swapon: /dev/sda2: Device or resource
    Message 1 of 9 , Dec 3, 2006
    • 0 Attachment
      Hello,
      I've followed the setup instructions for SlugOS 3.10 beta but I
      cannot get the swapon command to work. I get:

      swapon: /dev/sda2: Device or resource busy

      According to fdisk, the partition exists and is the right type (82 linux
      swap), but I don't see it in mount nor in df

      mount:
      rootfs on / type rootfs (rw)
      /dev/root on /initrd type jffs2 (ro)
      /dev/sda1 on / type ext3 (rw,data=ordered)
      proc on /proc type proc (rw)
      sysfs on /sys type sysfs (rw)
      /dev/sda1 on /dev/.static/dev type ext3 (rw,data=ordered)
      tmpfs on /dev type tmpfs (rw)
      /dev/sda3 on /opt type ext3 (rw,data=ordered)
      tmpfs on /media/ram type tmpfs (rw)
      usbfs on /proc/bus/usb type usbfs (rw)
      devpts on /dev/pts type devpts (rw)


      df:

      Filesystem 1k-blocks Used Available Use% Mounted on
      /dev/sda1 6528 5524 1004 85% /initrd
      /dev/sda1 23719032 147696 22366464 1% /
      /dev/sda1 23719032 147696 22366464 1% /dev/.static/dev
      tmpfs 10240 28 10212 0% /dev
      /dev/sda3 93706084 131228 88814800 0% /opt
      tmpfs 15148 0 15148 0% /media/ram

      Everything else seems to be working so far, anyone know how to get swap
      working or diagnose this futher?

      Thanks,

      John Cole
    • janne5011
      Hi I got the same problem, swap shows up if i do free but I dont think its works because swap is only 36 kb (or b?) whatever I did before. ... linux ... 1%
      Message 2 of 9 , Dec 3, 2006
      • 0 Attachment
        Hi I got the same problem, swap shows up if i do "free" but I dont
        think its works because swap is only 36 kb (or b?) whatever I did
        before.


        --- In nslu2-general@yahoogroups.com, John Cole <bitwise17-nslu2@...>
        wrote:
        >
        > Hello,
        > I've followed the setup instructions for SlugOS 3.10 beta but I
        > cannot get the swapon command to work. I get:
        >
        > swapon: /dev/sda2: Device or resource busy
        >
        > According to fdisk, the partition exists and is the right type (82
        linux
        > swap), but I don't see it in mount nor in df
        >
        > mount:
        > rootfs on / type rootfs (rw)
        > /dev/root on /initrd type jffs2 (ro)
        > /dev/sda1 on / type ext3 (rw,data=ordered)
        > proc on /proc type proc (rw)
        > sysfs on /sys type sysfs (rw)
        > /dev/sda1 on /dev/.static/dev type ext3 (rw,data=ordered)
        > tmpfs on /dev type tmpfs (rw)
        > /dev/sda3 on /opt type ext3 (rw,data=ordered)
        > tmpfs on /media/ram type tmpfs (rw)
        > usbfs on /proc/bus/usb type usbfs (rw)
        > devpts on /dev/pts type devpts (rw)
        >
        >
        > df:
        >
        > Filesystem 1k-blocks Used Available Use% Mounted on
        > /dev/sda1 6528 5524 1004 85% /initrd
        > /dev/sda1 23719032 147696 22366464 1% /
        > /dev/sda1 23719032 147696 22366464
        1% /dev/.static/dev
        > tmpfs 10240 28 10212 0% /dev
        > /dev/sda3 93706084 131228 88814800 0% /opt
        > tmpfs 15148 0 15148 0% /media/ram
        >
        > Everything else seems to be working so far, anyone know how to get
        swap
        > working or diagnose this futher?
        >
        > Thanks,
        >
        > John Cole
        >
      • Mike (mwester)
        ... On the contrary - something is quite right! The Swap line is telling you that it has 200MB of swap available for use, but it has only needed to use 36MB
        Message 3 of 9 , Dec 3, 2006
        • 0 Attachment
          > root@oldslug:~# free
          > total used free shared
          > buffers
          > Mem: 30300 25576 4724 0
          > 4648
          > Swap: 200804 36 200768
          > Total: 231104 25612 205492
          >
          > It looks like above-but it never seems to swap over "36" so something
          > is wrong..

          On the contrary - something is quite right! The "Swap" line is telling you
          that it has 200MB of swap available for use, but it has only needed to use
          36MB of that space.

          Mike (mwester)
        • Mike (mwester)
          Type free and see if the amount of space available for swapping is about the same as the size of /dev/sda2. If so, SlugOS probably automagically enabled
          Message 4 of 9 , Dec 3, 2006
          • 0 Attachment
            Type "free" and see if the amount of space available for swapping is about
            the same as the size of /dev/sda2. If so, SlugOS probably automagically
            enabled swapping on the swap partition on boot.
            Mike (mwester)

            ----- Original Message -----
            From: "John Cole" <bitwise17-nslu2@...>
            To: <nslu2-general@yahoogroups.com>
            Sent: Sunday, December 03, 2006 12:30 PM
            Subject: [nslu2-general] cannot swapon /dev/sda2


            > Hello,
            > I've followed the setup instructions for SlugOS 3.10 beta but I
            > cannot get the swapon command to work. I get:
            >
            > swapon: /dev/sda2: Device or resource busy
            >
            > According to fdisk, the partition exists and is the right type (82 linux
            > swap), but I don't see it in mount nor in df
            >
            > mount:
            > rootfs on / type rootfs (rw)
            > /dev/root on /initrd type jffs2 (ro)
            > /dev/sda1 on / type ext3 (rw,data=ordered)
            > proc on /proc type proc (rw)
            > sysfs on /sys type sysfs (rw)
            > /dev/sda1 on /dev/.static/dev type ext3 (rw,data=ordered)
            > tmpfs on /dev type tmpfs (rw)
            > /dev/sda3 on /opt type ext3 (rw,data=ordered)
            > tmpfs on /media/ram type tmpfs (rw)
            > usbfs on /proc/bus/usb type usbfs (rw)
            > devpts on /dev/pts type devpts (rw)
            >
            >
            > df:
            >
            > Filesystem 1k-blocks Used Available Use% Mounted on
            > /dev/sda1 6528 5524 1004 85% /initrd
            > /dev/sda1 23719032 147696 22366464 1% /
            > /dev/sda1 23719032 147696 22366464 1% /dev/.static/dev
            > tmpfs 10240 28 10212 0% /dev
            > /dev/sda3 93706084 131228 88814800 0% /opt
            > tmpfs 15148 0 15148 0% /media/ram
            >
            > Everything else seems to be working so far, anyone know how to get swap
            > working or diagnose this futher?
            >
            > Thanks,
            >
            > John Cole
            >
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
          • Mike (mwester)
            ... Of course, that *should* read 36KB, not 36MB. Sorry! Mike (mwester)
            Message 5 of 9 , Dec 3, 2006
            • 0 Attachment
              > ... but it has only needed to use
              > 36MB of that space.

              Of course, that *should* read 36KB, not 36MB. Sorry!

              Mike (mwester)
            • Laurent Gilson
              Hello, Another test is swapon -s: -s Display swap usage summary by device. Equivalent to cat /proc/swaps . or cat /proc/mounts (that is based on
              Message 6 of 9 , Dec 3, 2006
              • 0 Attachment
                Hello,

                Another test is swapon -s:

                -s Display swap usage summary by device. Equivalent to "cat
                /proc/swaps".

                or "cat /proc/mounts" (that is based on the kernel-data and not mtab. mtab
                may be wrong)

                cu
              • Phil Endecott
                ... Maybe you are already swapping on it. What does swapon -s say? Otherwise, the best way to diagnose Device or resource busy is the lsof program. Phil.
                Message 7 of 9 , Dec 3, 2006
                • 0 Attachment
                  > swapon: /dev/sda2: Device or resource busy

                  Maybe you are already swapping on it. What does "swapon -s" say?

                  Otherwise, the best way to diagnose "Device or resource busy" is the
                  lsof program.

                  Phil.
                • janne5011
                  Oh your fast I deleted it becuse it got wrong wrapped=). Output from swapon -s: used 35
                  Message 8 of 9 , Dec 3, 2006
                  • 0 Attachment
                    Oh your fast I deleted it becuse it got wrong wrapped=).
                    Output from swapon -s:
                    used 35 <----- it never goes over it
                    size 200804
                    partition 200804
                    priority -1

                    and then
                    -sh: /dev/sda2: Permission denied


                    --- In nslu2-general@yahoogroups.com, "Mike \(mwester\)"
                    <mwester@...> wrote:
                    >
                    > > ... but it has only needed to use
                    > > 36MB of that space.
                    >
                    > Of course, that *should* read 36KB, not 36MB. Sorry!
                    >
                    > Mike (mwester)
                    >
                  • janne5011
                    here is what cat /proc/mounts says: root@oldslug:~# cat /proc/mounts rootfs / rootfs rw 0 0 /dev/root /initrd jffs2 ro 0 0 /dev/sda1 / ext3
                    Message 9 of 9 , Dec 3, 2006
                    • 0 Attachment
                      here is what cat /proc/mounts says:

                      root@oldslug:~# cat /proc/mounts
                      rootfs / rootfs rw 0 0
                      /dev/root /initrd jffs2 ro 0 0
                      /dev/sda1 / ext3 rw,noatime,data=ordered 0 0
                      proc /proc proc rw 0 0
                      sysfs /sys sysfs rw 0 0
                      /dev/sda1 /dev/.static/dev ext3 rw,noatime,data=ordered 0 0
                      tmpfs /dev tmpfs rw 0 0
                      /dev/sda3 /media/sda3 ext3 rw,sync,data=ordered 0 0
                      tmpfs /media/ram tmpfs rw 0 0
                      usbfs /proc/bus/usb usbfs rw 0 0
                      devpts /dev/pts devpts rw 0 0
                      root@oldslug:~#


                      --- In nslu2-general@yahoogroups.com, "Laurent Gilson" <pumpkin@...>
                      wrote:
                      >
                      > Hello,
                      >
                      > Another test is swapon -s:
                      >
                      > -s Display swap usage summary by device. Equivalent
                      to "cat
                      > /proc/swaps".
                      >
                      > or "cat /proc/mounts" (that is based on the kernel-data and not
                      mtab. mtab
                      > may be wrong)
                      >
                      > cu
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.