Slackware :: Check If Device Is Mounted In A Bash Script?

Aug 1, 2010

Writing a bash script and I need to check if a known HD partition is mounted or not. I do not think /etc/mtab is the place to check. Would /proc/mounts always work? To make it simple like this : cat /proc/mounts | grep /dev/sdb2

View 5 Replies


ADVERTISEMENT

General :: Constantly Check Whether A Cd Is Mounted Or Not Using Bash?

Mar 20, 2010

i need to check if a cd is mounted or not using bash ... how is that possible?

View 8 Replies View Related

Slackware :: "Failed To Eject "VZAccess Manager Device To Unmount Is Not In /media/.hal-mtab So It Is Not Mounted By HAL"

Jul 12, 2010

I am running slackware-current and using the Novatel usb760 3G modem. before i use kppp to "dial out" I have to eject the device. It works fine except that i periodically get a popup window with:

"Failed to eject "VZAccess Manager Device to unmount is not in /media/.hal-mtab so it is not mounted by HAL."

it happens every 30 minutes to every 10 seconds. anyone ever experience something like this?

View 1 Replies View Related

Ubuntu :: User File System Check When Mounted?

Sep 1, 2011

A non techie friend has helped an even less techie friend by contacting me by email to discuss an ailing laptop. A few emails were exchanged, with more details, and it was not looking good because it seemed that suddenly the CD drive was not responding, nor any USB devices, the wireless icon was gone, but Ubuntu still seemed to work (for now), with wired ethernet also working. I was struggling to think of what could be done, with the favourite routes of Live CD and Live USB apparently gone.

After a few more hours - another email: 'It's now working! After so many reboots it checked disc for errors and repaired itself! Is there some way of doing that when needed anyway?'I see there is 'Disk Utility', and this would presumably fit the bill, but how does it do checks and repair when the damaged file system is being run, and is currently *mounted*? I thought utilities like fsck(?) could only be run on unmounted file systems? Have I misunderstood the disk utility fs check repair function? And anyway, what might be a good answer to my (nontechie) friend's question 'After so many reboots it checked disc for errors and repaired itself! Is there some way of doing that when needed anyway?'

For the record: (quote) It is a toshiba EA60-155 Model number PSA67E-00300C8J. He put in extra ram to install ubuntu. He thinks he may have deleted something! There is a 'trash' file on his USB drive with loads of stuff in it and he doesn't know how or why but because it won't now read the drive on her laptop we cant replace it! (end quote)

View 3 Replies View Related

Ubuntu Servers :: Backup Script To Check If A Path Is Mounted?

Mar 6, 2011

I'm writing a script to rsync some directories to external hdd for backup.

My external hdd gets automatically mounted to /media/backup1

My script then backs up predefined directories to /media/backup1.

I have added this script to cron to run once every day.

The problem is that in the case where the drive is not plugged in and the script runs, it backs up to my local hard drive, and since it is more than 70% full, it fills it up by duplicating that 70% onto itself.

I have taken the script further, to test whether /media/backup1 is mounted. If it is, the backup will run. If it is not, it will bail out.

I'm using the mountpoint program to test for mounts.

My script so far:

Code:
#!/bin/bash
if [[ `mountpoint /media/backup1` ]]; then
echo "filesystem mounted"
# The backup function. Commented out for testing.

[Code]....

View 9 Replies View Related

General :: CentOS - Disable Disk Check In Mounted USB Drive?

Aug 6, 2010

Is there a way to disable disk checks in a mounted usb drive? I have a 500GB usb mounted drive in my CentOS machine and everytime I reboot my system, it does disk checks which is a long painstaking process.
/mnt/sdb1

View 4 Replies View Related

Ubuntu :: Mounted Device Not Showing Up On Desktop

Feb 17, 2011

I have two external hard drives mounted to my computer. They both work and are accessible. The one shows up on my desktop when it is mounted just fine. The other one does not. I went in to Configuration editor-apps-nautilus-desktop and checked the volumes_visible. That makes the other one not visible/visible but not the one I am having problems with. I read somewhere that devices must be named for it to show up and both devices are named, I even changed the name and that didn't do anything. Again, this device shows up in my computer but not on my desktop like all my other devices do. If anyone has any ideas on how I can get this external hard drive to show up.

View 1 Replies View Related

Debian Configuration :: Safely Removing Mounted USB Device

Jan 7, 2011

I'm not sure if this is a bug in Squeeze beta 2 or if it's something I've overlooked. I have a Maxtor 250 GB external USB drive that I use for backups. It gets auto-mounted fine, always in the same place, and from my normal user account I can write to it, even delete directories on it if I want to. But when, from Gnome, I select the "Safely remove" option, I get an error to the effect that it can't stop the device. The weird thing is that the thing actually *is* unmounted. I've checked the mount point and it's no longer there.Is there some package I maybe should've installed but haven't? I'm not really worried about data loss, since I'm sure the drive wouldn't unmount unless it was properly synched; it's just the error message that bugs me.

View 2 Replies View Related

General :: Ubuntu - Find The Device Associated With A Mounted USB Drive?

Jun 23, 2010

How do you find the device (e.g. /dev/*) for a mounted USB drive in Linux (Ubuntu 10.04)? I'm trying to format a Cruzer USB flash drive, and when I plug it in, the icon for the mounted filesystem appears on my desktop. However, when I open GParted, it doesn't list the filesystem as an option to partition.

The recommendations I've found through Google include monitoring tail -f /var/log/messages, which they claim should list the device name when the drive is mounted, but this never happens for me. I've also read that the USB drive would usually be linked to /dev/sdb, but this appears as a broken link on my filesystem. How else would I find the device?

View 3 Replies View Related

Ubuntu :: Mounted Device / Drive Icon On Desktop

Feb 8, 2011

I've some icons of mounted devices on my desktop. I want to display only some of them which I need. All drives are mounted automatically while booting or by scripts while logging in.For example: I've 4 mounted devices and 4 icons on my desktop and I want to have 4 mounted devices but only 2 icons.There is possibility of hiding all of icons in gconf, but I want to hide only some of them.Is it possible?

View 4 Replies View Related

OpenSUSE Hardware :: USB Weirdness - Mounted External Drive Changes Device IDs

Jun 5, 2010

[openSUSE 11.1, kernel 2.6.27.45-0.1-Default, Gnome 2.26.3] I have a problem where I have an external USB drive which mounts at boot, with /home aboard it along with several data-only partitions, and if I try to add another USB drive *after* boot, the system changes the device IDs previously given to the original drive. The already running sdb now becomes sdc. If a user or processes are attached to /home when this occurs they are left in the twilight zone and stuff starts crashing. An added weirdness is the newly added drive isn't stealing the sdb ID, the added drive becomes sdd instead, and nothing at all is left at the sdb ID.

Note:

- System boots from sda, a non-USB drive with the system as well as /swap onboard, that should be uninvolved with the problem.

- Among the 4 partitions of the boot-mounted USB drive there are 2 lux-encrypted partitions (ext3). One is /home (originally encrypted under 10.3 and added back after machine upgraded to 11.1) and another being a data directory (later encrypted under 11.1).

- The problem _may_ occur only when the additional added drive is also lux-encrypted, but this may or may not be always true as I have limited other USB stuff to test with, most of it is also lux-encrypted.

View 1 Replies View Related

General :: Mounted Loop Device Prevents Proper Shutdown

May 4, 2011

I've recently started using Linux Mint (version 10) on a Dell Mini 1012 netbook. I'm using a loop device to mount a file on a NAS but whenever this loop device is mounted and has been accessed, my machine fails to shutdown.

Firstly I mount a share on the NAS using cifs (the NAS is aimed at Windows machines so doesn't support NFS). I have a sparse file on the share (which I created using Cygwin in Windows, using the dd command).

I used losetup to create a loop device and formatted it as reiserfs.This works and I can successfully use the mount point. I'm using it with Backintime.If I try to shutdown my machine without unmounting the loop device, shutdown hangs.

These messages just keep repeating and the system never shuts down.So I assume the problem is something to do with unmounting the CIFS/loop device.If I unmount the loop device all is fine. I don't need to unmount the cifs share.Any ideas on how to resolve? Should I add a script to run during shutdown (i.e linked from /etc/rc0.d and /etc/rc6.d) to sync and unmount the loop device? Or is there a better solution?

View 1 Replies View Related

Networking :: Export A Raw Device Through NFS/CIFS To Be Mounted At Remote Location?

Nov 17, 2010

Can we export a raw device through NFS/CIFS to be mounted at remote location?

View 2 Replies View Related

Slackware :: VirtualBox - Windowsxp Guest - No Sound - Unknown Audio Device - In The Windows Device Manager

Mar 11, 2010

For those that use Virtualbox on their slackware host and have a windows (xp) guest running. I have tried various settings for sound (Alsa, PulseAudio), the AC97 drivers are installed in the Windows xp guest os, but there is no sound and there is an unknown audio device (in the windows device manager). If I remove the AC97 drivers and use the soundblaster16 drivers in the Vbox settings there is no unknown sound device, but there's still no sound. why I can't get sound working?

View 13 Replies View Related

Ubuntu :: Bash Script - Run Different Rsync Cmds Based On Which Devices Are Mounted

Apr 2, 2010

having my data backed up properly, but it's also in different places (e.g. photos and music on separate flash drives), so I have a few rsync's that I can execute manually, drives are mounted. Unfortunately, it gets confusing very quickly, I'd like a simple bash script that goes something like this (this pseudo-code would be most like REXX):

pair.1 = (/dev/sdb1, /dev/mmcblkp01)
pair.2 = (/some/other/device, /yet/another/device)
for i = 1 to #pairs

[code]....

Seems simple enough, but I've never written a bash script and wouldn't know where to start.

View 5 Replies View Related

Slackware :: Bash - Random Headers When Starting Bash In X?

Jan 13, 2011

I have searched and searched and maybe I don't know how to articulate this issue with out just posting the problem I'm having. Every time I bring up a terminal window I get the following "Header"

declare -x COLORTERM="gnome-terminal"
declare -x CPLUS_INCLUDE_PATH="/usr/lib64/qt/include"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-xSFd6zqrYQ,guid=dc5e07974559da016842742900000090"
declare -x DISPLAY=":0.0"

[Code]...

To be honest I cheated and used the .bashrc / .profile files from Ubuntu and all was working fine for a while now and it seems something changed to cause this... any ideas on why I am getting this? I checked my .bashrc and my /etc/profile and it doesn't look like anything is amiss..

View 3 Replies View Related

Slackware :: Drivers For Slackware And Compatibility Check

Mar 15, 2010

Im trying to get away from the world of M$ into linux and I think slackware is the way to go for me. In particular SW13-64bit. My question is though I dont see many hardware manufacturers supporting SW, but I do see suse and redhat. How hard/possible is it to use redhat suse drivers for slackware? Can they be modified/rebuilt?

Im also considering buying a cheap server off ebay to use. Can someone let me know if any of the following would cause an issue with slackware?In particular the Adaptec sata raid controller which I want to run in raid 5.

View 2 Replies View Related

Slackware :: 13.1 Does Not Recognize Mounted CD

May 27, 2010

I've just installed Slack 13.1, this was a "clean" install. All seems to be working well except for the dvd-rw, but this is a show stopper, if it doesn't get resolved in a few days I'll have to go back to 13.0.

The drive is detected correctly, but if a cd is mounted it gets errors, and is unable to set it up (it doesn't appear on the desktop).

Here is the info from dmesg:

ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata3.00: ATAPI: TSSTcorp CDDVDW SH-S223Q, SB03, max UDMA/100
ata3.00: configured for UDMA/100
scsi 2:0:0:0: CD-ROM TSSTcorp CDDVDW SH-S223Q SB03 PQ: 0 ANSI: 5
sr0: scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2 cdda tray

[Code].....

View 14 Replies View Related

Ubuntu Networking :: Check The All Device Information?

Nov 25, 2010

how to check the all device information on ubuntu

View 1 Replies View Related

Networking :: Script To Check Mounting Device?

Jun 20, 2011

I have written a script to take backup of my database in remote server which is a windows machine.i have mounted that machine to my server using the script and daily script will run automatically, i have scheduled it using crontab like that and backup will be taken. but if my remote server is down means it gets unmounted and my backup falls on my local linux server itself. i want a script to check whether the remote server is mounted or not if mounted take the backup or else stop the backup.

View 2 Replies View Related

Software :: How To Check Which Process Is Accessing Device?

Feb 7, 2010

I wonder if there is a command that can tell me which process is accessing a folder, say, /mnt? Sometimes I forgot which process is accessing /mnt and therefore cannot umount /mnt.

View 4 Replies View Related

General :: Running A Check In Bash Script?

Apr 3, 2011

so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g.

unknown-hacker|544> count.sh 1 3
1
2
3

My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2 numbers, etc., you'd get an error message

View 15 Replies View Related

General :: BASH Scripts Check For Arguments

Mar 5, 2010

I know that $1 ... $n will set the argument to the values but what happened if I have many options in one scripts lets suppose.

I can run:
myscript -1stargument -2ndargument -3rdargument
or myscript -1stargument
or myscript -1stargument -3rdargument

In my scripts I have
if [ $1 = "-1stargument" -o $2 = "-2ndargument"] #for every instruction I need
fi

but is there any way to do:
if [ (any arguments or commands) = "(mydesired option ] ; then
(do this...)
fi

View 6 Replies View Related

General :: Check Which Version Of Bash I'm Running ?

Aug 16, 2010

How can I check which version of bash I'm running

View 2 Replies View Related

General :: Can Bash Check If Screensaver Is Running

Nov 13, 2010

I have a bash script that messages the user periodically. Is there any way in the script to check if the screensaver is running, so the script doesn't spam messages while the user is away? The xscreensaver process is always running in the background, I've noticed.

View 5 Replies View Related

General :: Check If Directory DOES NOT Exist In BASH?

May 10, 2010

i tried to create a if else statements or either an else statement I get a message saying that the directory exists (mkdir: cannot create directory `./MAY2010': File exists I am running this in a crontab file and I dont want any output telling me that the directory exists. I just want to check if the directory doesnt exist, create one else do nothing (not even a message telling me that the directory exists).

[Code]....

View 8 Replies View Related

Programming :: BASH - Can't Check If XScreenSaver Is Running

Feb 26, 2011

I'm having trouble trying to make a script. What I want to do is check if xScreenSaver is running in my user account. If not, run it. If it's running, kill it.

So this is the script I've made:

Code:

The problem is that I've echoed the output of $(pgrep -u $(whoami) xscreensaver) and it always seems to add 4 numbers to the pid, even if the pid doesn't exist. What do I mean by "doesn't exist"? That no xscreensaver is running in my user, and if I run pgrep -u $(whoami) xscreensaver in bash, I get not output, but if I run the command though the script, I get (for instance) 4050. If I run it again, I get 4054, and again 4058... etc. What the hell is going on with that?

View 5 Replies View Related

Programming :: Bash Function Check For Valid IP?

Apr 16, 2010

I have been working on this way too long now...this *should* be simple. I must be missing something simple at this point.

Code:
function f_is_ip()
{
if [ "`echo "$1" | /bin/egrep "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}"`" != "" ] ## Error on this line

[Code]....

When I echo $1 ## prints 192.168.1.22

View 4 Replies View Related

Slackware :: Failed To Initialize NVIDIA Graphics Device On Startx With Slackware 13.1

Aug 24, 2010

I installed slackware 13.1 x86_64 bit with multilib, and its been about a month already, I'm really enjoying slackware but I am being troubled with my nvidia card, and I need to get my 3D acceleration working. And I've been looking around the net for information and kept on trying to make my nvidia card to work but to no avail. I cant get X to start, once I put in a xorg.conf stating to use the nvidia card. After troubleshooting for almost 2 weeks and now at my wits end, I now come humbly looking for help in linuxquestions slackware community forum.I've installed nvidia 64 bit kernel, drivers from slackbuilds (version 256.44). The laptop model I'm trying to get it working is an -ASUS K52J Intel Core i3 2.40Ghz with 2GB RAM and with an Nvidia Geforce 310M with 1GB dedicated VRAM.

View 14 Replies View Related

Ubuntu Multimedia :: Check If Display Device Is Connected?

Feb 10, 2010

I am trying to write a script to turn my HTPC off automatically and turn it back on again at a specified interval.

I've got the turn on off bit sorted using /sys/class/rtc/rtc0/wakealarm but I want the script to not turn the machine off if say something is downloading, I am currently watching something etc and i dont think I will have any trouble with that.

But what I would really like to be able to do is tell if my TV is currently on. I dont think anything x11 related would work here and this may not even be possible. Does Ubuntu "know" if it's display device is powered on or not? if so can I interrogate this somehow?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved