LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 04-07-2007, 08:49 PM   #1
kc5hwb
Member
 
Registered: Jun 2001
Location: Colleyville, Texas
Distribution: Ubuntu 6.10
Posts: 82

Rep: Reputation: 15
Can I add this line to FSTAB ?


Code:
mount /dev/sdxx /drives/<drive1name>

I use this code to mount a SATA drive on my Ubuntu 6.10 Server. And each time I reboot, I have to add it again. Can I simply add this line to my FSTAB file? Do I need to add any other piece of code for it to work in FSTAB ?
 
Old 04-07-2007, 08:56 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 58
examine your fstab file and youll see the other entries there.. you have to specify afew more options, the only real important one is the filesystem
Code:
/dev/sdxx       /drives/<drive1name>        <filesystem>        <options>    1   0
check 'man mount' or 'man fstab' for more options.
 
Old 04-07-2007, 08:57 PM   #3
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Normally I would refer you to the man page that describes the fstab file but I just checked and that particular page really stinks.

First, use the existing records in the fstab file as an example for your new line.

The first field is the name of the block device.

The second field is the mount point.

The third field is the type of file system on the block device.

The fourth field is mount options separated by a comma.

The fifth field has something to do with the dump function. Whatever.

The sixth field tells the boot sequence if a file system should be checked with fsck during system boot. Actually the man page says that it can be used for creating the sequence that file systems are checked with fsck during system boot time. All of the fstab files that I've seen have either a 1 or a 0 there.

Addendum: I see that nadroj beat me by one minute. Curse you nadroj and your proficiency in typing.

Last edited by stress_junkie; 04-07-2007 at 09:00 PM.
 
Old 04-07-2007, 09:05 PM   #4
snowtigger
Member
 
Registered: Mar 2005
Location: england
Distribution: slackware, win2k
Posts: 364

Rep: Reputation: 34
almost, you will want to add some other bits aswell.

an example

/dev/cdrom /mnt/cdrom auto noauto,users,ro 0 0

which breaks down to this,

"the device to mount" "where to mount" "filesystem type" "options" "fs_freq" "fs_passno"

this example mounts the device cdrom (which is actually a symlink to /dev/hdc on my system) to the place /mnt/cdrom, it checks automatically what filesystem it is using (normally iso9660 for cd's) and has the options of noauto (doesn't get mounted at boot time), users (any user can mount or umount), ro (read-only).Then the fist 0 means it won't get dumped, this is to do with some backup systems. And the second 0 is to do with the order that fsck checks the system.

The best thing you can do is read the man page for fstab.This can be found on your system or in case you did not install the man pages it can also be found on the web. One place that i use alot is http://www.die.net/doc/linux/man/



Looks like you both beat me

Last edited by snowtigger; 04-07-2007 at 09:06 PM.
 
Old 04-07-2007, 09:18 PM   #5
kc5hwb
Member
 
Registered: Jun 2001
Location: Colleyville, Texas
Distribution: Ubuntu 6.10
Posts: 82

Original Poster
Rep: Reputation: 15
I read the man fstab page and I didn't know what the " 0 0 " crap meant, so that makes it a little clearer, thanks.

The only 2 things showing in my fstab are the 2 partitions on my main HDD since this install is only 1 week old.

So how would this work?

mount /dev/sdxx /drives/<drive1name> smbfs auto,jason,rw 0 0

Its a shared network drive on another Ubuntu box on my network, shared with Samba (since I also have 4 other windows boxes), it should get mounted at bootup, read-write, and the 0 0 garbage. Look ok?
 
Old 04-07-2007, 09:20 PM   #6
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,240

Rep: Reputation: 121Reputation: 121
If you use a 2 instead of the final 0, then fsck will be run about every 30 or so boots. If you don't, and if you don't check it manually from time to time, it's possible for the filesystem to get corrupted so bad that your data is irretrievable.
 
Old 04-08-2007, 02:23 PM   #7
kc5hwb
Member
 
Registered: Jun 2001
Location: Colleyville, Texas
Distribution: Ubuntu 6.10
Posts: 82

Original Poster
Rep: Reputation: 15
mount /dev/sdxx /drives/<drive1name> smbfs auto,jason,rw 0 2

Makes sense, this should do it then, right?
 
Old 04-08-2007, 02:28 PM   #8
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,240

Rep: Reputation: 121Reputation: 121
Code:
mount /dev/sdxx /drives/<drive1name> smbfs auto,jason,rw 0 2
Makes sense, this should do it then, right?
Sorry, but no. You do not use the word "mount" in fstab:
Code:
/dev/sdxx /drives/<drive1name> smbfs auto,jason,rw 0 2
Added:
Hmmm, I haven't paid attention to the filetype until just now. It's probably not appropriate to try to run fsck on an smbfs disk. Sorry about that. Only use 2 on the final number if the physical disk is actually bolted into your machine or plugged in via USB etc.

73

Last edited by Quakeboy02; 04-08-2007 at 02:31 PM.
 
Old 04-08-2007, 02:51 PM   #9
kc5hwb
Member
 
Registered: Jun 2001
Location: Colleyville, Texas
Distribution: Ubuntu 6.10
Posts: 82

Original Poster
Rep: Reputation: 15
Ok, cool. Yes, this is a samba network drive, not a secondary local drive. Thanks for the help.

QRT
 
  


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
Line 7 in /etc/fstab is bad!!! Please Help da_xlnc Linux - General 9 07-20-2006 06:03 AM
Line 7 in fstab bad.... cooljed Linux - General 1 01-11-2006 06:42 AM
Bad line in fstab dubya Fedora 2 06-19-2005 02:49 PM
Weird fstab line dom_lochet Linux - Newbie 3 02-10-2005 06:23 AM
add smbmount drives to fstab? woja Linux - Newbie 1 11-07-2003 03:14 PM


All times are GMT -5. The time now is 06:34 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration