Ubuntu This forum is for the discussion of Ubuntu Linux. |
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.
|
 |
04-07-2007, 08:49 PM
|
#1
|
Member
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102
Rep:
|
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 ?
|
|
|
04-07-2007, 08:56 PM
|
#2
|
Senior Member
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539
Rep:
|
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.
|
|
|
04-07-2007, 08:57 PM
|
#3
|
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873
|
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.
|
|
|
04-07-2007, 09:05 PM
|
#4
|
Member
Registered: Mar 2005
Location: england
Distribution: slackware, win2k
Posts: 364
Rep:
|
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.
|
|
|
04-07-2007, 09:18 PM
|
#5
|
Member
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102
Original Poster
Rep:
|
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?
|
|
|
04-07-2007, 09:20 PM
|
#6
|
Senior Member
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,410
Rep: 
|
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.
|
|
|
04-08-2007, 02:23 PM
|
#7
|
Member
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102
Original Poster
Rep:
|
mount /dev/sdxx /drives/<drive1name> smbfs auto,jason,rw 0 2
Makes sense, this should do it then, right?
|
|
|
04-08-2007, 02:28 PM
|
#8
|
Senior Member
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,410
Rep: 
|
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.
|
|
|
04-08-2007, 02:51 PM
|
#9
|
Member
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102
Original Poster
Rep:
|
Ok, cool. Yes, this is a samba network drive, not a secondary local drive. Thanks for the help.
QRT
|
|
|
All times are GMT -5. The time now is 07:33 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
|
|