LinuxQuestions.org
Register a domain and help support LQ
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 07-31-2008, 07:10 PM   #1
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Rep: Reputation: 15
fstab when no disk?


Hi guys,

If a machine running linux doesn't have a hard disk (i.e. booting from a CD or network or something like that), what happens to the fstab? Where is it going to be stored? Who makes this fstab? linux or should I do it myself?

Thanks alot guys
 
Old 07-31-2008, 07:26 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,546
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,
Quote:
Originally Posted by alirezan1 View Post
Hi guys,

If a machine running linux doesn't have a hard disk (i.e. booting from a CD or network or something like that), what happens to the fstab? Where is it going to be stored? Who makes this fstab? linux or should I do it myself?

Thanks alot guys
You could 'man fstab'!

Code:
excerpt from 'man fstab';

NAME
       fstab - static information about the filesystems

SYNOPSIS
       #include <fstab.h>

DESCRIPTION
       The  file fstab contains descriptive information about the various file
       systems.  fstab is only read by programs, and not written;  it  is  the
       duty  of  the system administrator to properly create and maintain this
       file.  Each filesystem is described on a separate line; fields on  each
       line are separated by tabs or spaces.  Lines starting with '#' are com-
       ments.  The order of records in fstab  is  important  because  fsck(8),
       mount(8),  and umount(8) sequentially iterate through fstab doing their
       thing.

       The first field, (fs_spec),  describes  the  block  special  device  or
       remote filesystem to be mounted.

       For  ordinary  mounts  it  will hold (a link to) a block special device
       node (as created by mknod(8))  for  the  device  to  be  mounted,  like
       `/dev/cdrom'   or   `/dev/sdb7'.    For   NFS   mounts  one  will  have
       <host>:<dir>, e.g., `knuth.aeb.nl:/'.  For procfs, use `proc'.
 
Old 07-31-2008, 07:37 PM   #3
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Original Poster
Rep: Reputation: 15
Alright! I didn't know I could use man for fstab too! Sorry!

So, I should create fstab myself right? Linux doesn't create it by itself. Then why knoppix when boots says:

"Scanning for Harddisk Partitions and creating /etc/fstab..."?
--> http://services.arnit.net/images_to_...1936190731.jpg


Sorry if my questions are basic, but I really need to understand this.

Thanks
 
Old 07-31-2008, 07:44 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Some distro's dynamically edit /etc/fstab when you add an external drive. Other distro's don't and use udev/hal and helper programs instead to handle these.

If you don't have a disk, you will be loading the kernel and mounting an nfs root filesystem which will contain an /etc/fstab file. (Here I'm referring to a slim client). For a live distro, the filesystem is in ram. The live distro will examine any hard drives present and mount them somewhere, such as under /mnt/. This enables you to edit files you need to change to be able to boot your computer if you have a problem, or to work with files on the computer, such as displaying files in "My Documents" on a windows computer.
 
Old 07-31-2008, 08:15 PM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
/etc/fstab is located on whatever media you boot. If you boot a CD it is on the CD. If you boot from the network then /etc/fstab is on whatever you booted from out in the network.

In a few cases when you boot a CD or a network the Linux you boot creates a RAM disk where it creates a few files like /etc/fstab. I think knoppix is building a /etc/fstab file for you in a RAM disk.

------------------
Steve Stites

Last edited by jailbait; 07-31-2008 at 08:16 PM.
 
Old 08-01-2008, 05:42 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 3,957

Rep: Reputation: Disabled
On SuSE there is also an "mtab". It contains the really and truly mounted devices (e.g. you can umount devices contained in fstab. Then they are still in fstab, but not in mtab).
 
Old 08-02-2008, 02:58 AM   #7
mccwho
LQ Newbie
 
Registered: May 2008
Location: Columbus
Distribution: RH, CentOS, Debian, Ubuntu, Mandrevia
Posts: 7

Rep: Reputation: 0
You can use find

You can also use the find or locate command.
I like to use find as it does not pull its information from a database.
you could use something like the following;
# find / -iname 'fstab'
(I like to use -iname , because its insensitive to case, especially when I am having a hard time locating a file).
It will search every directory, on all mounted devices. It will take a while, but its thorough.

PS: Knoppix does use a ram disk if your booting it from CD as in a live CD. IF you look in the middle of screen image you posted you can see it displays "..../ramdisk."
IF you want to know what the partition is that it created as a ram disk just type "mount" with no switches.

Last edited by mccwho; 08-02-2008 at 03:08 AM.
 
  


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
USB external hard disk and fstab sblantipodi Linux - General 8 01-06-2008 02:14 PM
Mount removable disk without root access and fstab entry - possible? FogSwimmer Linux - Hardware 2 08-31-2007 07:41 PM
hard disk trouble in FC5 [parted and/or fstab] rik_cross Fedora 1 09-16-2006 04:30 PM
what entries to put into fstab for new hard disk? chuck_notorious Linux - Hardware 1 04-21-2004 04:37 AM
Mounting hard disk through fstab aiims1777 Linux - Newbie 5 11-05-2003 06:36 AM


All times are GMT -5. The time now is 12:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration