Solved

fstab shows swap exists but swapon -s shows nothing. swapon /dev/sda2 replies with  No such device or address

Posted on 2006-11-29
8
639 Views
Last Modified: 2012-05-05
fstab shows swap exists but swapon -s shows nothing. swapon /dev/sda2 replies with  No such device or address.
I have tried to mkswap and receive /dev/sda2: No such device or address.
I see the device file in /dev so I do not know why I am receiving the no device error message.
If there are no other ideas, my next step would be to go through the installation and try to delete swap and recreate it. Hopefully this will not destroy the data out there. I really do not want to have to reformat the hard drive and start over.
Any clues before I have to take this step?
Thanks
0
Comment
Question by:narcus
  • 3
  • 3
  • 2
8 Comments
 
LVL 38

Expert Comment

by:wesly_chen
Comment Utility
Could you post the result for the following commands for people here to help you:
cat /etc/fstab
fdisk -l
df -h
mount
0
 
LVL 2

Author Comment

by:narcus
Comment Utility
Here are the results of the commands requested to run.
Thx for the help.

[root@server root]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/d01              /d01                    ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/home             /home                   ext3    defaults        1 2
LABEL=/opt              /opt                    ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/usr              /usr                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
/dev/sda2               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1             /mnt/cdrom1             udf,iso9660 noauto,owner,kudzu,ro 0 0
[root@server root]# fdisk -l

Disk /dev/sda: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda doesn't contain a valid partition table

Disk /dev/sdb: 35.8 GB, 35836133376 bytes
64 heads, 32 sectors/track, 34176 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sdb1   *         1       500    511984   83  Linux
/dev/sdb2           501      6500   6144000   82  Linux swap
/dev/sdb3          6501     11500   5120000   83  Linux
/dev/sdb4         11501     34176  23220224    f  Win95 Ext'd (LBA)
/dev/sdb5         11501     15500   4095984   83  Linux
/dev/sdb6         15501     17500   2047984   83  Linux
/dev/sdb7         17501     18500   1023984   83  Linux
/dev/sdb8         18501     19000    511984   83  Linux
/dev/sdb9         19001     34176  15540208   83  Linux
[root@server root]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             485M  237M  224M  52% /
/dev/sdb9              15G  7.6G  6.4G  55% /d01
/dev/sdb7             985M   17M  918M   2% /home
/dev/sdb5             3.9G   88M  3.6G   3% /opt
none                  2.0G     0  2.0G   0% /dev/shm
/dev/sdb8             485M  8.7M  451M   2% /tmp
/dev/sdb3             4.9G  2.0G  2.6G  44% /usr
/dev/sdb6             2.0G  100M  1.8G   6% /var
/dev/vg1/lv1          247G  102G  132G  44% /d02
[root@server root]# mount
/dev/sdb1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/sdb9 on /d01 type ext3 (rw)
/dev/sdb7 on /home type ext3 (rw)
/dev/sdb5 on /opt type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/sdb8 on /tmp type ext3 (rw)
/dev/sdb3 on /usr type ext3 (rw)
/dev/sdb6 on /var type ext3 (rw)
/dev/vg1/lv1 on /d02 type ext3 (rw)
0
 
LVL 11

Expert Comment

by:kblack05
Comment Utility
Can you run the 'lsmod' command and post it?

In particular I'm wondering if you are running any of these modules:

ieee1394
ohci1394
raw1394
sbp2

0
 
LVL 2

Author Comment

by:narcus
Comment Utility
Here is the output of lsmod.
I do not see any of the entries you questioned.
Thx.
[root@server root]# lsmod
Module                  Size  Used by    Not tainted
loop                   12728   0  (autoclean)
lvm-mod                65600   3  (autoclean)
ipmi_devintf            5192   1
ipmi_si_drv            28392   1
ipmi_msghandler        29252   0  [ipmi_devintf ipmi_si_drv]
dell_rbu                8128   0
audit                  90872   2  (autoclean)
usbserial              23804   0  (autoclean) (unused)
lp                      9156   0  (autoclean)
parport                38848   0  (autoclean) [lp]
autofs4                17464   0  (autoclean) (unused)
bnx2                  137960   1  (autoclean)
crc32                   3764   0  (autoclean) [bnx2]
sg                     37292   0  (autoclean)
sr_mod                 17880   0  (autoclean)
cdrom                  32896   0  (autoclean) [sr_mod]
usb-storage            75168   0
microcode               6912   0  (autoclean)
keybdev                 2976   0  (unused)
mousedev                5688   1
hid                    22532   0  (unused)
input                   6176   0  [keybdev mousedev hid]
ehci-hcd               20776   0  (unused)
usb-uhci               26860   0  (unused)
usbcore                81344   1  [usbserial usb-storage hid ehci-hcd usb-uhci]
ext3                   90088   8
jbd                    55380   8  [ext3]
megaraid_sas           24732   0
qla2300               766492   1
diskdumplib             5260   0  [qla2300]
sd_mod                 14256  16
scsi_mod              116140   6  [sg sr_mod usb-storage megaraid_sas qla2300 sd_mod]
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Expert Comment

by:kblack05
Comment Utility
Ok I'm wondering if the drive in question is USB or external/internal SATA? SCSI?
0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 500 total points
Comment Utility
> fidks -l
> Disk /dev/sda doesn't contain a valid partition table

> /dev/sdb2           501      6500   6144000   82  Linux swap

It seems to me that swap is on /dev/sdb2, not /dev/sda2.
Please modify /etc/fstab for swap to /dev/sdb2.
And then mouunt the swap again.
0
 
LVL 11

Expert Comment

by:kblack05
Comment Utility
Good eye Wesley
0
 
LVL 2

Author Comment

by:narcus
Comment Utility
Thanks to all.
That fixed it.
I'm not sure how it happened...but that is for another day.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now