LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fstab when no disk? (https://www.linuxquestions.org/questions/linux-newbie-8/fstab-when-no-disk-659602/)

alirezan1 07-31-2008 06:10 PM

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

onebuck 07-31-2008 06:26 PM

Hi,
Quote:

Originally Posted by alirezan1 (Post 3232584)
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'.


alirezan1 07-31-2008 06:37 PM

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

jschiwal 07-31-2008 06:44 PM

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.

jailbait 07-31-2008 07:15 PM

/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

JZL240I-U 08-01-2008 04:42 AM

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).

mccwho 08-02-2008 01:58 AM

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.


All times are GMT -5. The time now is 01:41 AM.