LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hard drive partitions not set up in fstab/mtab (https://www.linuxquestions.org/questions/linux-newbie-8/hard-drive-partitions-not-set-up-in-fstab-mtab-373898/)

odyssey84 10-17-2005 07:32 AM

Hard drive partitions not set up in fstab/mtab
 
Greetings,

I recently reloaded SuSE 9.3 and it is not seeing two hard drive partitions that it had previously seen (it had previously read their names as they were set up under Partition Magic/XP). I've received a message stating that they are not listed in fstab and mtab. Can I add the paths into these files or will using the partitioner to set up the mount point work? Any assistance would be greatly appreciated.

Thanks,

Scott

b0nd 10-17-2005 08:19 AM

Hello,
post the entries of
#cat /etc/fstab
and
#fdisk -l

regards

MensaWater 10-17-2005 08:22 AM

I don't use Suse. Typically though, creating filesystems is comprised of the following steps:

1) Make the partition using a utility such as fdisk or parted (or if doing LVM you'd make a logical volume using lvcreate).

2) Tell the partition it is a filesystem using the newfs command. NOTE: This will overwrite anything on the partition.

3) Make the directory "mount point" for the filesystem. This is the directory you want the filesystem to be mounted as such as /home.

4) Add the entry to /etc/fstab. In /etc/fstab you add the device name, the mount point the filesystem type and options if any.

5) Mount the filesystem. You can do this by specifying all the information from item 4 or better yet simply by typing "mount /mountpoint" where "/mountpoint" is the directory you created in item 3. The benefit to doing comes from the fact you don't give it the device and options so it has to read the fstab to get that information. So if it successfully mounts then you know the fstab entry is correct. (Also of course it saves you some keystrokes.)

CAUTION: From what you wrote it appears you're saying your partitions already exist. If so you've already completed steps 1 and 2 so do NOT want to do them again as they'll overwrite any data already on the filesystem.

odyssey84 10-17-2005 10:38 AM

Thanks. I'll have to post the entries later - I'm not at the machine at the moment.

I'm having trouble with the 3rd step (make the directory "mount point"). Is this an arbitrary designation and what are the steps?

Thanks again.

MensaWater 10-17-2005 10:54 AM

Its arbitrary. You're just making an empty directory path. This is the directory you would go to as the base of the filesystem.

If you do "df -k" on your system you'll see your existing filesystems. The first column is the "device" and the last column is the "mount point".

A good example that most fstabs will have is the CD. From my Debian for example:
/dev/cdrom /cdrom iso9660 ro,user,noauto 0 0

For above entry /dev/cdrom is the device and /cdrom is the mount point. If you do NOT have a CD in the CD drive and do ls -l /cdrom you'll see it is an empty directory. However once you put a CD in the drive and it mounts and you do an ls -l /cdrom you'll see the contents of the CD.

Note that /dev/cdrom can actually be mounted on ANY directory (assuming it isn't busy). You could if you wanted do:

mkdir /mycd

then edit fstab to have "/mycd" instead of "/cdrom" as the mount point.

odyssey84 10-17-2005 06:54 PM

Thanks.

Here are the entries from mtab & fstab. Adding the information in the files doesn't appear to be too difficult. I'm just curious what the additional information means and how do I adapt it to my particular system. Let me know if you could.

/etc/mtab

/dev/sda2 / reiserfs rw,acl,user_xattr 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/sdc1 /media/BUSLINK subfs rw,nosuid,nodev,sync,fs=floppyfss,procuid 0 0
/dev/fd0 /media/floppy subfs rw,nosuid,nodev,sync,fs=floppyfss,procuid 0 0

/etc/fstab
/dev/sda2 / reiserfs acl,user_xattr 1 1
/dev/sdb1 swap swap pri=42 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
proc /proc proc defaults 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
sysfs /sys sysfs noauto 0 0
/dev/dvdrecorder /media/dvdrecorder subfs noauto,fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
/dev/dvdrecorder2 /media/dvdrecorder2 subfs noauto,fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
/dev/fd0 /media/floppy subfs noauto,fs=floppyfss,procuid,nodev,nosuid,sync 0 0

MensaWater 10-18-2005 07:59 AM

First:
Do NOT edit /etc/mtab. This file is maintained by the mount itself. It just shows you what IS mounted at the point you look at it.

/etc/fstab on the other hand is the table of what SHOULD BE mounted and is typically used at boot time to mount the filesystems. As noted in my prior post it IS intended to be edited and is read when you type a mount command that doesn't specify all the information.

You can see details of fstab just by typing "man fstab". Also "man mount" will give you more information. Different filesystem types will have different options.

For the first filesystem in your fstab:
/dev/sda2 / reiserfs acl,user_xattr 1 1

/dev/sda2 = The device to be mounted. From its name we can tell:
-sd = SCSI Disk
-sda = First SCSI Disk
-sda2 = Partition two of First SCSI Disk

/ = The mount point (directory). "/" by itself is called "root" and all other mounts have to be somewhere below root in the heirarchical directory structure of Linux/Unix.

reiserfs = Filesystem type. A couple of others are ext2, ext3.

acl,user_xattr = Comma delimited list of options for the filesystem type. Some options are common to multiple filesystem types but some are unique to the one you are using. You can have more or less options than seen for this example. The "man mount" will tell you the
meaning of most options.

The 1 and 1 = fs_freq and fs_passno respectively. Look at "man fstab" for detailed explanation of what these do.


All times are GMT -5. The time now is 02:40 PM.