LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-19-2008, 09:15 AM   #1
morphynoman
Member
 
Registered: Nov 2008
Posts: 32

Rep: Reputation: 15
fstab question


Hi, I'm running Slackware 12.0 and this is my fstab:

Code:
aufs / aufs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
/dev/hda /mnt/hda iso9660 auto,users,exec 0 0 # AutoUpdate
/dev/fd0 /mnt/floppy vfat noauto,noatime,users,suid,dev,exec 0 0 #AtoUpdate
/dev/sda1 /mnt/sda1 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate
/dev/sda2 /mnt/sda2 swap defaults # Autoupdate
/dev/sda3 /mnt/sda3 ext3 auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda4 /mnt/sda4 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate

/dev/sdb /mnt/sdb vfat auto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb2 /mnt/sdb2 vfat auto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb1 /mnt/sdb1 ntfs auto,noatime,users,suid,dev,exec,ro 0 0 # AutoUpdate
When booting or shuting down it tells me:

Code:
fstab: line 8 is bad


but I can't find why


Thanks to those who lose 1 second with this

Last edited by morphynoman; 11-19-2008 at 09:17 AM.
 
Old 11-19-2008, 09:20 AM   #2
Chromezero
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470

Rep: Reputation: 40
That's because line 8 is your swap partition. It should look more like this...
Code:

/dev/sda2  swap     swap defaults                         0 0 # Autoupdate
/dev/sda3 /mnt/sda3 ext3 auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda4 /mnt/sda4 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate

Last edited by Chromezero; 11-19-2008 at 09:35 AM. Reason: re-formatted the layout for easier readability
 
Old 11-19-2008, 09:20 AM   #3
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Think it need a simple change

nvm Chromezero got it first lol.

Last edited by Hern_28; 11-19-2008 at 09:21 AM. Reason: too late :p
 
Old 11-19-2008, 09:37 AM   #4
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Swap space is not mounted or used like other mounted file systems.

Try changing your line 8 to:
Code:
/dev/sda2 none swap sw 0 0
 
Old 11-22-2008, 06:21 PM   #5
morphynoman
Member
 
Registered: Nov 2008
Posts: 32

Original Poster
Rep: Reputation: 15
On one hand I tried
Code:
/dev/sda2  swap     swap defaults                         0 0 # Autoupdate
but still getting the same error. On the other hand , does
Code:
/dev/sda2  none     swap defaults                         0 0 # Autoupdate
allow me to use the swap space?
 
Old 11-22-2008, 06:24 PM   #6
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
As mentioned your swap is not really mounted as a drive. Here is a print out from my fstab.

Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/hdd        /media/cdrom1   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
/dev/hdb1       /usr            ext3    defaults        0       0
/dev/sda1       /media/backup   ext3    defaults        0       0
 
Old 11-24-2008, 05:29 AM   #7
morphynoman
Member
 
Registered: Nov 2008
Posts: 32

Original Poster
Rep: Reputation: 15
Tried both (swap and none) and the problem remains the same
 
Old 11-24-2008, 07:58 AM   #8
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Could you post your fstab? It will help us alot better.
 
Old 11-24-2008, 09:06 AM   #9
Chromezero
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470

Rep: Reputation: 40
Just to double check, is /dev/sda2 formatted as a swap partition? If it's formatted as ext3, it can't be used as a swap partition. You should be able to use fdisk to take a look.
Code:
fdisk /dev/sda
Then hit p to print the partition scheme to screen. Then q to quit.
 
Old 11-24-2008, 05:14 PM   #10
morphynoman
Member
 
Registered: Nov 2008
Posts: 32

Original Poster
Rep: Reputation: 15
When I posted for 1st time this was my fstab:
Code:
Morphy rc.d # cat /etc/fstab
aufs / aufs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
/dev/hda /mnt/hda iso9660 auto,users,exec 0 0 # AutoUpdate
/dev/fd0 /mnt/floppy vfat noauto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda1 /mnt/sda1 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate
/dev/sda2 /mnt/sda2 swap sw # Autoupdate
/dev/sda3 /mnt/sda3 ext3 auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda4 /mnt/sda4 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate

/dev/sdb /mnt/sdb vfat noauto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb2 /mnt/sdb2 vfat noauto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb1 /mnt/sdb1 ntfs noauto,noatime,users,suid,dev,exec,ro 0 0 # AutoUpdate
After that:
Code:
Morphy rc.d # cat /etc/fstab
aufs / aufs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
/dev/hda /mnt/hda iso9660 auto,users,exec 0 0 # AutoUpdate
/dev/fd0 /mnt/floppy vfat noauto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda1 /mnt/sda1 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate
/dev/sda2 swap swap sw # Autoupdate
/dev/sda3 /mnt/sda3 ext3 auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda4 /mnt/sda4 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate

/dev/sdb /mnt/sdb vfat noauto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb2 /mnt/sdb2 vfat noauto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb1 /mnt/sdb1 ntfs noauto,noatime,users,suid,dev,exec,ro 0 0 # AutoUpdate
And finally
Code:
Morphy rc.d # cat /etc/fstab
aufs / aufs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
/dev/hda /mnt/hda iso9660 auto,users,exec 0 0 # AutoUpdate
/dev/fd0 /mnt/floppy vfat noauto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda1 /mnt/sda1 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate
/dev/sda2 none swap sw # Autoupdate
/dev/sda3 /mnt/sda3 ext3 auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda4 /mnt/sda4 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate

/dev/sdb /mnt/sdb vfat noauto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb2 /mnt/sdb2 vfat noauto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
/dev/sdb1 /mnt/sdb1 ntfs noauto,noatime,users,suid,dev,exec,ro 0 0 # AutoUpdate
It is a swap partition but here's fdisk
Code:
Morphy rc.d # fdisk /dev/sda

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26         150     1004062+  82  Linux swap
/dev/sda3             151        6838    53721360   83  Linux
/dev/sda4            6839       19457   101362117+  83  Linux

Last edited by morphynoman; 11-24-2008 at 05:15 PM.
 
Old 11-24-2008, 05:21 PM   #11
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Is there some reason that you are not putting the 0 0 at the end of your swap line as follows?

Code:
/dev/sda2  none     swap sw                         0 0 # Autoupdate

Last edited by AuroraCA; 11-24-2008 at 05:23 PM.
 
Old 11-24-2008, 05:38 PM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
Each line in fstab (but comments) has 6 (no more, no less, I mean really "six") fields. "man fstab" will give you the details if you are interested. The line that AurocaCA posted is the right one, assuming that sda2 is the right partition. Swap partitions are not mounted, so the mount point is "none" and that's how it should remain. Type swap, options "sw" are the standard for swap partitions. The other two fields can be "0 0", but that doesn't meant that they can be ignored. They must be there. So fix your fstab and all should be fine.

Again, I really advise you to read the fstab man page, you will save yourself a lot of trouble.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/fstab question unixshell101 Linux - Newbie 5 01-27-2008 10:29 PM
fstab question Lleb_KCir Linux - General 2 04-12-2005 01:11 AM
/etc/fstab question joker20 Linux - Newbie 16 09-15-2004 09:33 PM
question about /etc/fstab nny0000 Slackware 6 04-27-2004 07:42 PM
i have an fstab question... isajera Linux - General 7 12-21-2001 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration