Test to see if a drive is mounted at a specific point


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Test to see if a drive is mounted at a specific point
# 1  
Old 05-10-2005
Test to see if a drive is mounted at a specific point

I have a script that backs up our storage drive daily to one external drive and weekly to another. What I'd like to do is find a way, in the script, to test whether the drives are mounted so that it doesn't accidentally fill up the main drive in the event of a drive failure, etc. Any ideas on how to accomplish this?
# 2  
Old 05-10-2005
You can use the df command to get the device associated with a mount.
Check your man page for df as it may not have the -v option I show in the example.

df -v /var |tail -1|awk '{print $2}'
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change file permission of mounted drive Linux

I got a problem with the permission of mounted 2TB drive in my Linux/Mint system. All the files in any folder are with 777, which is not what I want. my fstab line for this disk is: UUID=90803E0C803DF974 /media/grape/Workspace1_ntfs ntfs auto,users,permissions 0 0 and blkid gave me: $> blkid ... (4 Replies)
Discussion started by: yifangt
4 Replies

2. Solaris

In Solaries 10 how to mount multiple volume on same mounted point

Hi , I am completely stuck and not getting any clue to come out this . So looking for help Q : I have salaries 10 in server with that Dell Equallogic storage connected. in dell Equlalogic in i have 70 TB storage . I created 7 volumes 10 TB each . In Solaries 10 i have syslog server i... (1 Reply)
Discussion started by: Roahn Tiwari
1 Replies

3. UNIX for Dummies Questions & Answers

Join Lines at a specific point

Hi I'm a beginner, and i've been having trouble joining two lines. I need to convert this file 1097ALABAMA Mobile County METHOMYL INSE CTICIDES 6 1.6200000E+00 1.8000001E+00 1003ALABAMA Baldwin County ... (5 Replies)
Discussion started by: kf_1434
5 Replies

4. Shell Programming and Scripting

Listing latest & large files from a mounted drive

Hi All, My AIX server have a mounted drive "/stage". I want to list the latest modified/created files in this drive. Also large files in this drive. I tried to ls -l | sort +4nr | head -10 Someother solutions to list from entire drive. Thanks. :) (6 Replies)
Discussion started by: karumudi7
6 Replies

5. Ubuntu

how to mount specific drive for specific users in ubuntu 11.04?

hi friends ... could u tell me how to mount specific drive (ntfs or fat 32) for specific users in ubuntu 11.04 ? ie ,if there is a user called staff (a desktop user ) ,then he should able to use staff drive only ? thanks in advance ...:) (1 Reply)
Discussion started by: kapali255
1 Replies

6. UNIX for Dummies Questions & Answers

NFS mounted drive showing Write protected message

Hi We have two servers name A and B . I have a folder "Share" on A was NFS mounted to "B" server. I have set the ACL permissions using setfacl , so that both (One user from Server A and another user from Server B) users can read and write to the directory. Both users can create the... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

7. Shell Programming and Scripting

Removing all characters on and before specific point

Im having a file with records DB1635 |Y|N|DB1632 |000024968_202 |0|000024968302|RCF02| DB1636 |Y|N|DB1633 |000024968_203 |0|000024968302|RCF02| i want to get output as Y|DB1632 |RCF02| Y|DB1633 |RCF02| how can i do this ?? any... (3 Replies)
Discussion started by: Trendz
3 Replies

8. Filesystems, Disks and Memory

how to assign same mount point for file systems mounted on physical disks

We have 6 hard disks attached to the hardware. Of this 2 hard disks are of 9 GB each. Now I want combine both the same in such a way that i see a combined entry in the output of df -k . The steps I follow are 1. Create partition on hard disks (Using format partition) 2. Run newfs -v for... (6 Replies)
Discussion started by: Hitesh Shah
6 Replies
Login or Register to Ask a Question