Sponsored Content
Top Forums Programming Mount from C code with --no-mtab? Post 302883004 by shamrock on Friday 10th of January 2014 11:03:48 AM
Old 01-10-2014
Have you tried using the MS_READONLY flag to the mount syscall and below is an excerpt from the mount syscall manpage...
Code:
The mountflags argument may have the magic number 0xC0ED (MS_MGC_VAL) in the top 16 bits
(this was required in kernel versions prior to 2.4, but is no longer required  and  ignored
if specified), and various mount flags (as defined in <linux/fs.h> for libc4 and libc5 and in 
<sys/mount.h> for glibc2) in the low order 16 bits:
       .
       .
       .
       MS_RDONLY
              Mount file system read-only.

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to mount a hotswap scsi drive on a solaris 2.6 netra box using the mount command?

Hi... question is this: How do I mount an LVD hotswap scsi drive in bay #2 on a netra using the mount command? volmgt doesn't seem to mount it and/or I don't know how to view the drives data if it's formatted which it may not be. This drive is not new out of the box so I'm not sure. ... (4 Replies)
Discussion started by: soulshaker
4 Replies

2. UNIX for Dummies Questions & Answers

editing mtab

Hi all and Happy New Year!! I'm teaching myself Unix on two Linux boxes (one Red Hat, one SuSE). Anyway, I downloaded and installed patches and fixes for my SuSE box and now I can't mount my cdrom as a user. An error pops up: Could not mount mount according to mtab, /dev/hdc is mounted on... (1 Reply)
Discussion started by: SeCBerm
1 Replies

3. Programming

code mount in c language

HI All: Where I can find out the mount lib or function to view because I think about using c to mount a file system without shell command. Thanks (7 Replies)
Discussion started by: jeter
7 Replies

4. UNIX for Dummies Questions & Answers

Mount

Hey, need to mount the following below, and new ish to unix.. what is the process.. thanks :b: # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 <SEAGATE-ST973401LC-0001 cyl 51057 alt 2 hd 4 sec 702> /pci@1d,700000/scsi@4/sd@0,0 (5 Replies)
Discussion started by: blb
5 Replies

5. UNIX for Dummies Questions & Answers

mount -o llock -F nfs vs mount -F nfs

Hi, We encountered NFS issue (solaris) especially running on Oracle application. Problem such as forms hang when close button is click, concurrent job shows running status all time. Understand we need to use mount -o llock -F nfs instead of mount -F nfs to eliminate? this problem.. Can... (1 Reply)
Discussion started by: KhawHL
1 Replies

6. UNIX for Dummies Questions & Answers

mount

hi can some in layman terms plz xplain me d use n implementation of mount command ......m confused..:(:( (1 Reply)
Discussion started by: jaini
1 Replies

7. UNIX for Advanced & Expert Users

mount -t cifs permission denied by mount -t smbfs works fine

I am having trouble mounting with cifs, but mounting the exact same command with smbfs works fine. The share is on another samba server and is set to full public guest access. # mount -t cifs //servername/sharename /mnt/temp -o password="" mount error 13 = Permission denied Refer to the... (3 Replies)
Discussion started by: humbletech99
3 Replies

8. IP Networking

Can't see home folder on one NFS mount but can in another mount on another share

Hello, I have a few Ubuntu 9.10 laptops I'm trying to learn NFS sharing with. I am just experimenting on this right now, so no harsh words about the security of what I'm playing with, please ;) Below are the configs /etc/exports on host /home/woodnt/Homeschool... (2 Replies)
Discussion started by: Narnie
2 Replies

9. Shell Programming and Scripting

Script to mount nas-share using generated credentials (mount EC 13,32)

Heyas At home i have 1 nas with 3 shares, of which i used to mount 2 of them using a script with hardcoded password and username in it. EDIT: Turns out, its not the script, but 'how i access' the nas share.. (-o user=XY,password=... VS. -o credentials=...). Figured about credential files,... (0 Replies)
Discussion started by: sea
0 Replies

10. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies
MOUNT.NFS(8)						      System Manager's Manual						      MOUNT.NFS(8)

NAME
mount.nfs, mount.nfs4 - mount a Network File System SYNOPSIS
mount.nfs remotetarget dir [-rvVwfnsh ] [-o options] DESCRIPTION
mount.nfs is a part of nfs(5) utilities package, which provides NFS client functionality. mount.nfs is meant to be used by the mount(8) command for mounting NFS shares. This subcommand, however, can also be used as a standalone command with limited functionality. remotetarget is a server share usually in the form of servername:/path/to/share. dir is the directory on which the file system is to be mounted. Under Linux 2.6.32 and later kernel versions, mount.nfs can mount all NFS file system versions. Under earlier Linux kernel versions, mount.nfs4 must be used for mounting NFSv4 file systems while mount.nfs must be used for NFSv3 and v2. OPTIONS
-r Mount file system readonly. -v Be verbose. -V Print version. -w Mount file system read-write. -f Fake mount. Don't actually call the mount system call. -n Do not update /etc/mtab. By default, an entry is created in /etc/mtab for every mounted file system. Use this option to skip making an entry. -s Tolerate sloppy mount options rather than fail. -h Print help message. nfsoptions Refer to nfs(5) or mount(8) manual pages. NOTE
For further information please refer nfs(5) and mount(8) manual pages. FILES
/etc/fstab file system table /etc/mtab table of mounted file systems SEE ALSO
nfs(5), mount(8), AUTHOR
Amit Gud <agud@redhat.com> 5 Jun 2006 MOUNT.NFS(8)
All times are GMT -4. The time now is 03:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy