Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-30-2003, 05:32 PM   #1
Registered: Sep 2003
Distribution: Slamd64
Posts: 168

Rep: Reputation: 30
mount a partition and swapon on boot(fstab??)

i'm pretty sure i'm suppose to use the fstab file somehow to mount my partitions and swap partition, but i looked at that file and can't figure what to put in that file

right now i'm just running these commands at boot and that works

/sbin/swapon /dev/hdb1


mount -t ext2 /dev/hda2 /files/netboot

so considering these are the two commands that work, what should i add to the fstab file, and what are those last three columns in the fstab file

i'm using slackware 9 if that makes any difference
Old 10-01-2003, 04:03 AM   #2
LQ Guru
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
man fstab
Old 10-01-2003, 05:47 AM   #3
LQ Newbie
Registered: Jul 2003
Posts: 6

Rep: Reputation: 0
/dev/hda2 /files/netboot ext2 noatime 0 1
/dev/hdb1 none swap sw 0 0

Try something like that.
Device MountPoint Type Options

Last edited by computerjunkie; 10-01-2003 at 05:48 AM.
Old 10-01-2003, 05:59 AM   #4
Registered: Dec 2001
Location: Portugal
Distribution: /Red Hat/Fedora/Solaris
Posts: 622

Rep: Reputation: 30

try this will work, /dev/hd?? swap swap defaults 0 0

Old 10-01-2003, 06:53 AM   #5
Registered: Sep 2002
Location: Haarlem , the Netherlands
Distribution: VectorLinux SOHO 5.1
Posts: 470

Rep: Reputation: 35
OK ; chewing it out for you :

Here's what my fstab looks like:
# /etc/fstab: static file system information.
# The following is an example. Please see fstab(5) for further details.
# Please refer to mount(1) for a complete description of mount options.
# Format:
# <file system> <mount point> <type> <options> <dump> <pass>
# dump(8) uses the <dump> field to determine which file systems need
# to be dumped. fsck(8) uses the <pass> column to determine which file
# systems need to be checked--the root file system should have a 1 in
# this field, other file systems a 2, and any file systems that should
# not be checked (such as MS-initrd/mnt or NFS file systems) a 0.

# This is a root linux ext2 partition:
/dev/hda8 / ext3 defaults,errors=remount-ro 0 1
/dev/hdc1 /hdc1 ext3 defaults 0 2

# This is a linux ext2 partition:
#/dev/hda2 /mnt/linux ext2 defaults 0 2

# The 'noauto' option indicates that the file system should not be mounted
# with 'mount -a' 'user' indicates that normal users are allowed to mount
# the file system.
/dev/cdrom /mnt/cdrom iso9660 defaults,noauto,ro,user 0 0
/dev/fd0 /mnt/floppy auto defaults,noauto,user 0 0
#/dev/fd1 /mnt/floppy auto defaults,noauto,user 0 0

# If you have a ls-120 floppy drive, it could be on /dev/hda b c d etc.
#/dev/hdd /mnt/ls120 auto defaults,noauto,user 0 0

# NFS file systems: /mnt/nfs nfs defaults 0 0

# proc file system:
proc /proc proc defaults 0 0

# Unix98 devpts filesystem:
none /dev/pts devpts gid=5,mode=666 0 0

# Shared memory filesystem:
#none /var/shm shm defaults 0 0
# Basic USB filesystem
usbdevfs /proc/bus/usb usbdevfs defaults,noauto 0 0

# For dos partition use type 'msdos'.
# For win95/98 fat16 or FAT32 partition use type 'vfat'.

# The 'sw' option indicates that the swap partition is to be activated
# with 'swapon -a'.
/dev/hda6 none swap sw 0 0

# Swap file:
#/swap none swap sw 0 0

/dev/cdwriter /mnt/cdwriter iso9660 defaults,noauto,ro,user 0 0
/dev/cdwriter /mnt/cdwriter iso9660 defaults,noauto,ro,user 0 0
Where /dev/hda8 is my root-partition and /dev/hdc1 is my extra drive , I use for backups.
I bolded out the relevant part.

First part is , ofcourse , the partition you want to mount.
Second part is the mountpoint. You have to have made a Directory with that same name before editing fstab.
Third part is the format-type(self-explanatory)
fourth part is about the options , you want it to have. Save for your root-partition , "defaults" will be sufficient
fifth part is is the value , "dump" uses. a 0 is pretty much ok.
Sixth part is the value , "pass" will need. Only the root-partition uses value "1" , your other partitions , if they are just on harddisks that is , will use "2"

I have no experience with booting from a 'net , but taking the other answers into account , I figure that requires a "0" for "pass".


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
nfs: fstab will not mount at boot tredegar Linux - Networking 15 08-13-2013 05:24 PM
Delay fstab mount of smbfs during boot Iron City Linux - General 7 01-21-2009 03:58 PM
/home partition will not mount at boot despite fstab settings zach_barrow Slackware 11 03-10-2005 11:24 PM
Why a FSTAB entry will mount using -a switch but will not mount automatically at boot mjen Linux - Newbie 3 05-19-2004 08:45 AM
Compiled RH7.3 to read WinXP NTFS partition, mounts in Console, but can't mount fstab BlackDogg Linux - Newbie 20 08-06-2002 12:15 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:11 AM.

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