Sponsored Content
Full Discussion: automount script
Top Forums Shell Programming and Scripting automount script Post 302263493 by unclecameron on Monday 1st of December 2008 05:25:07 PM
Old 12-01-2008
automount script

I'm attempting to take an fstab that looks something like this:

Code:
/proc      /proc       proc   rw,nosuid,nodev,noexec 0 0
/sys       /sys        sysfs  rw,nosuid,nodev,noexec 0 0
/dev/shm   /dev/shm    tmpfs  rw,nosuid,nodev,noexec 0 0
/dev/pts   /dev/pts    devpts mode=0622           0 0
/dev/fd0   /media/fd0  auto   user,noauto,exec,umask=000    0 0
/dev/cdrom /media/cdrom  auto   user,noauto,exec,ro 0 0
/dev/hdc /media/hdc  auto   users,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/sda1 /media/sda1 ntfs noauto,users,exec,umask=000,uid=knoppix,gid=knoppix 0 0
# Added by KNOPPIX
/dev/sda2 /media/sda2 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sda3 none swap defaults 0 0vv

and write a script to loop through the "# Added by KNOPPIX" entries, then cut c1-9 off the next line and run mount $whatever-I-just-detected /mountpoint and also write that mountpoint to a file.

How would I write the condition to find "# Added by KNOPPIX" and then get it to look at the next line, first 9 characters, basically how can I get sed/awk/whatever to read something like this line by line and not go to the next line until it did something?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

automount

I install an external disk on my sun solaris 8 this went fine and I was able to access all filesystem on the disk. the new disk is mounted on /local then 6 hours later files under /local/files was 1 byte in size at the same time I received the following error message in... (4 Replies)
Discussion started by: hassan2
4 Replies

2. UNIX for Advanced & Expert Users

Automount

My site has a few sun solaris server including out NIS server and NFS server on solaris machines. we also have few suse linux and redhat linux machine. All our home directory is on our NFS server(sun Solaris) and this is automounted through /etc/auto_master and /etc/auto_home this worked fine... (1 Reply)
Discussion started by: hassan2
1 Replies

3. UNIX for Advanced & Expert Users

AutoMount

Hi All How do I do a auto mount to a directory in a different unix server. I am using Solaris. Please advise!! TIA Jana (7 Replies)
Discussion started by: janavenki
7 Replies

4. Solaris

CD automount does not work

Hello, I have a SUN Solaris 9 machine (Sun-Fire-V490). I put a DVD in the reader to install a software. The automount procedure did not work (vold is running) : I have nothing under /cdrom When I try "eject" command I have the answer "No default media available" When I try to mount manually the... (3 Replies)
Discussion started by: aribault
3 Replies

5. UNIX for Dummies Questions & Answers

Automount issue

Folks; I'm mounting a directory on a different SUSE 10 server from my SUSE server fine. using this mount command: # mount 192.168.132.11:/var/local/new /var/local/new this command above works fine but when i added a new line to my "/etc/fstab" to be mounted automatically every time i... (2 Replies)
Discussion started by: Katkota
2 Replies

6. Solaris

Automount in Solaris 10

Hi friends I'm a newbie trying to automount a nfs shared directory. Below is the configuration I'm using FreeBSD machine as NFS server. IP Address - 192.168.1.60 # cat /etc/exports /shared 192.168.1.50 Solaris 10 as NFS client. IP Address - 192.168.1.50 # cat... (1 Reply)
Discussion started by: pankajj
1 Replies

7. AIX

Help on Unconfiguring Automount

Hi All, Please help. I need an advise on how to Unconfigure automount please. Many Thanks. (2 Replies)
Discussion started by: EngnrRG
2 Replies

8. Linux

Automount problem

Hi, Please give step by step how to do automount in linux Thanks, Mani (9 Replies)
Discussion started by: Mani_apr08
9 Replies

9. Red Hat

Automount in RHEL

Hello experts, On my RHEL box when i mount a nfs file system using autofs, the df -t shows the file system as nfs only. For which mounts does it report the filesystem as autofs. ?? I actually want to see the filesystem getting reported as autofs instead of nfs. Pls guide me I... (1 Reply)
Discussion started by: achak01
1 Replies

10. Red Hat

Need help with automount.. is not working!!

When i export the directory where the data really is, i can specify which hosts can mount it. On the remote server i create a mount point directory and then mount it to the source servers directory (that has the data). I need to run my script on Server X , i would login there and type in the... (11 Replies)
Discussion started by: bkilaru
11 Replies
halmount(1)							   User Commands						       halmount(1)

NAME
halmount - mount and umount filesystems via hal SYNOPSIS
halmount [OPTIONS]... <device|label> [mountpoint] halmount -u [OPTIONS]... <device|label|mountpoint> halmount -e [OPTIONS]... <device|label|mountpoint> DESCRIPTION
halmount can mount and umount filesystems via hal. Hotpluggable devices and media such as USB sticks and CD-ROMs are typically not entered into /etc/fstab and are therefore not mountable by normal users via the mount(8) command. Instead hal provides methods to mount and umount such devices. Additionally it's also possible to eject devices. For devices like USB sticks eject means the device cannot be mounted again until the stick is re-plugged, ie a "save remove" feature. OPTIONS
-t TYPE specify the file system type to use -o OPTIONS specify mount options -v verbose listing of devices -u umount specified device -e umount and eject specified device -a perform requested mount/umount/eject operation all available devices --listudi list UDIs of devices, useful for debugging EXAMPLES
halmount list all mountable devices known to hal halmount /dev/hdc mount device hdc on default mount point (/media/volumelabel) halmount /dev/hdc cdrom mount device hdc on /media/cdrom halmount -u "Holiday Pictures" umount device that has the label "Holiday Pictures" SEE ALSO
mount(8), umount(8), eject(1), fstab(5) SUSE Linux November 2006 halmount(1)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy