Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #923
Difficulty: Medium
Unix has a tradition of directly representing non-integer Unix time numbers as binary fractions.
True or False?
Linux & Unix Commands - Search Man Pages

getfsspec(3) [bsd man page]

GETFSENT(3)						     Library Functions Manual						       GETFSENT(3)

NAME
getfsent, getfsspec, getfsfile, getfstype, setfsent, endfsent - get file system descriptor file entry SYNOPSIS
#include <fstab.h> struct fstab *getfsent() struct fstab *getfsspec(spec) char *spec; struct fstab *getfsfile(file) char *file; struct fstab *getfstype(type) char *type; int setfsent() int endfsent() DESCRIPTION
Getfsent, getfsspec, getfstype, and getfsfile each return a pointer to an object with the following structure containing the broken-out fields of a line in the file system description file, <fstab.h>. struct fstab { char *fs_spec; char *fs_file; char *fs_type; int fs_freq; int fs_passno; }; The fields have meanings described in fstab(5). Getfsent reads the next line of the file, opening the file if necessary. Setfsent opens and rewinds the file. Endfsent closes the file. Getfsspec and getfsfile sequentially search from the beginning of the file until a matching special file name or file system file name is found, or until EOF is encountered. Getfstype does likewise, matching on the file system type field. FILES
/etc/fstab SEE ALSO
fstab(5) DIAGNOSTICS
Null pointer (0) returned on EOF or error. BUGS
All information is contained in a static area so it must be copied if it is to be saved. 4th Berkeley Distribution May 12, 1986 GETFSENT(3)

Check Out this Related Man Page

GETFSENT(3)						   BSD Library Functions Manual 					       GETFSENT(3)

NAME
getfsent, getfsspec, getfsfile, setfsent, endfsent -- get file system descriptor file entry LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <fstab.h> struct fstab * getfsent(void); struct fstab * getfsspec(const char *spec); struct fstab * getfsfile(const char *file); int setfsent(void); void endfsent(void); DESCRIPTION
The getfsent(), getfsspec(), and getfsfile() functions each return a pointer to an object with the following structure containing the broken- out fields of a line in the file system description file, <fstab.h>. struct fstab { char *fs_spec; /* block special device name */ char *fs_file; /* file system path prefix */ char *fs_vfstype; /* type of file system */ char *fs_mntops; /* comma separated mount options */ char *fs_type; /* rw, ro, sw, or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; The fields have meanings described in fstab(5). The setfsent() function opens the file (closing any previously opened file) or rewinds it if it is already open. The endfsent() function closes the file. The getfsspec() and getfsfile() functions search the entire file (opening it if necessary) for a matching special file name or file system file name. For programs wishing to read the entire database, getfsent() reads the next entry (opening the file if necessary). All entries in the file with a type field equivalent to FSTAB_XX are ignored. RETURN VALUES
The getfsent(), getfsspec(), and getfsfile() functions return a null pointer (0) on EOF or error. The setfsent() function returns 0 on fail- ure, 1 on success. The endfsent() function returns nothing. FILES
/etc/fstab SEE ALSO
fstab(5) HISTORY
The getfsent() function appeared in 4.0BSD; the endfsent(), getfsfile(), getfsspec(), and setfsent() functions appeared in 4.3BSD. BUGS
These functions use static data storage; if the data is needed for future use, it should be copied before any subsequent calls overwrite it. BSD
June 4, 1993 BSD

15 More Discussions You Might Find Interesting

1. Linux

/etc/fstab

I've created a new drive and i've added it to my fstab file but on startup it will not mount. here is how i put it into my fstab file, is that right? /dev/hdb2 /disk2a ext3 defaults 1 2 (6 Replies)
Discussion started by: byblyk
6 Replies

2. UNIX for Dummies Questions & Answers

fstab question

Folks; Please be patient with this issue when you read it. I know it's a little tricky. I have a new share created on my SUSE 10 box. I'm trying to edit the /etc/fstab file or find a way to make this share needs no authentication. The reason for that is we're using an outside application to... (3 Replies)
Discussion started by: Katkota
3 Replies

3. UNIX for Dummies Questions & Answers

odd entry in /etc/fstab

I was making text file copies of some system utility output (e.g. ioscan) and happened to look at /etc/fstab and found this: /dev/vg02/lvol1 /prodbkup vxfs ioerror=mwdisable,log,nodatainlog,dev=40 020001 0 0 my other entries look like this: /dev/vg04/lvol1 /trainbkup vxfs... (4 Replies)
Discussion started by: LisaS
4 Replies

4. UNIX for Dummies Questions & Answers

problem booting

Dear List, While I was adding second hard disk to my system, I changed the /etc/fstab file by adding the following line: /mnt/sdb1 /dev/sdb1 ext3 default 2 1 Now system does not boot and gives the following error: Checking filesystems /: Clean, 309260/18495840 files, 1064776/18486790... (2 Replies)
Discussion started by: siavoush
2 Replies

5. Red Hat

edit/write the /etc/fstab file

Hi, I comment out some vol group in fstab accidentally. I also comment the swap space in /etc/fstab But I cannot edit /remove it back by using vi /etc/fstab again in init 1 and init 6 . The file system /etc/fstab is read -only . I cannot chmod ..... What can I do in order to recover it ... (2 Replies)
Discussion started by: chuikingman
2 Replies

6. UNIX for Dummies Questions & Answers

copy of /etc/fstab on server

hi does any one know how i can: the directory wood should contain a copy of the file /etc/fstab on the server, renamed as saw i have tried cp /etc/fstab wood but not sure how to rename it at the same time any help would be greatly appreciated (3 Replies)
Discussion started by: bashSmash
3 Replies

7. UNIX for Dummies Questions & Answers

fstab

hi , i'm creating a shell script using fstab for my project of last year, i wonder you can help me to know what is the command allow me to get the list of unmounted partitions. thanks (4 Replies)
Discussion started by: Linux001
4 Replies

8. Shell Programming and Scripting

Add option to fstab

I need as script (awk/sed?) to add noatime option to fstab. It should append ,noatime to whatever is in column 4 if noatime isn't already there, leaving comments alone. input: # /etc/fstab # Created by anaconda on Mon Oct 31 20:44:41 2011 # # Accessible filesystems, by reference, are... (5 Replies)
Discussion started by: pblumenthal
5 Replies

9. Shell Programming and Scripting

Help to resolve unexpected EOF while looking for matching `"' error

Hi, can someone kindly look into my copy script and figure out why am i getting a "unexpected EOF while looking for matching `"' error message #!/bin/ksh -x cd /home/goldenga/test/flag37 if ; then rm copied.ok cd /home/goldenga/test Upper=`ls -t|grep 'qw*'|cut -d "w" -f 2|head... (4 Replies)
Discussion started by: NDalal007
4 Replies

10. Red Hat

Effects of /etc/fstab file!

Hi Folks! I accidentally overwrote in /etc/fstab file. Can you guys please tell me, what impact it would have created, when I restarted the machine(RHEL6). I executed this command : # blkid /dev/vda5 > /etc/fstab (17 Replies)
Discussion started by: nixhead
17 Replies

11. Red Hat

How to find cause for empty fstab after patching?

Hi, I patched my RHEL 5.8 using yum update and then followed by updating vmware tools on my Virtual machine ( hosted on Vpshere), This is Oracle Database server. After this when i rebooted - I saw may failed in the console.....with read only filesystem...........cat /etc/fstab was... (2 Replies)
Discussion started by: saurabh84g
2 Replies

12. Shell Programming and Scripting

Mount/fstab Question . . .

Greetings! Got another basic question for the community :) After wiping a drive with dd, and calling mkfs.ext4 to set things up again, fstab seems to need to be refreshed somehow to allow a call to mount for the volume. What might the "secret handshake" be to pull this off without first... (6 Replies)
Discussion started by: LinQ
6 Replies

13. Fedora

Fstab for 2nd hdd, how to?

once again, mounting another volume or hdd the fstab-file is giving me a headache. May someone could give me a hint how to configure the fstab-file properly to use the hdd. The following ls -l /dev/disk/by-uuidis giving me this Thats the UUID for /dev/sdb1 with the name "save"... (6 Replies)
Discussion started by: 1in10
6 Replies

14. Linux

/etc/fstab entries

Hi, Can anyone explain why we use defaults 0 0 in fstab and what does 0 inidicate 10.250.104.50:/home/u /home/u nfs defaults 0 0 Thanks in advance Muzaffar (3 Replies)
Discussion started by: muzaffar.k
3 Replies

15. Shell Programming and Scripting

How to replace value in fstab file?

Hi, I am looking to replace value (fifth and sixth ) column to "0 0" in /etc/fstab file by scripting. can any one please help me. /dev/VolGroup00/tmp /tmp ext3 defaults 1 1 (2 Replies)
Discussion started by: yash_message
2 Replies

Featured Tech Videos