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
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
11-19-2008, 09:15 AM
#1
Member
Registered: Nov 2008
Posts: 32
Rep:
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 .
11-19-2008, 09:20 AM
#2
Member
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470
Rep:
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
11-19-2008, 09:20 AM
#3
Member
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906
Rep:
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
11-19-2008, 09:37 AM
#4
Member
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370
Rep:
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
11-22-2008, 06:21 PM
#5
Member
Registered: Nov 2008
Posts: 32
Original Poster
Rep:
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?
11-22-2008, 06:24 PM
#6
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
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
11-24-2008, 05:29 AM
#7
Member
Registered: Nov 2008
Posts: 32
Original Poster
Rep:
Tried both (swap and none) and the problem remains the same
11-24-2008, 07:58 AM
#8
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
Could you post your fstab? It will help us alot better.
11-24-2008, 09:06 AM
#9
Member
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470
Rep:
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.
11-24-2008, 05:14 PM
#10
Member
Registered: Nov 2008
Posts: 32
Original Poster
Rep:
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 .
11-24-2008, 05:21 PM
#11
Member
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370
Rep:
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 .
11-24-2008, 05:38 PM
#12
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083
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.
All times are GMT -5. The time now is 03:39 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News