Fedora :: Automatically Run Script On Optical Disc Is Mount?
Feb 23, 2010
how to get a bash script to automatically launch when the optical drive mounts a disc, any type of disc - DVD, CD, data, etc. It seems like such a simple task but after weeks of searching I have yet to find a workable solution.
I'm trying to get a script to run whenever an optical disc is mounted by the system but can't get it to work. I'm running Fedora 12 64bit and the drive is SATA device sr0.
Following online guides, I created a new rule file called '10-my.rules' in '/etc/udev/rules.d' which contains the following:
But nothing happens when a disc is mounted. The script itself runs fine manually and is clearly evident when launched so the problem must be the rule file. I've tried changing the name of the rule file in a few incremental steps from 10-my.rule to 99-my.rule to no effect.
I've gathered some information about my optical drive using the udevadm tool. Here is the result of an info query:
From the terminal, or a script, how can I determine the media type (CDDA, DVD, ISO, etc) of a mounted optical disc? I need this for an automated script on my headless media server - Fedora 12 64bit.
My girlfriend has a dual boot netbook I set up for her with Vista + 9.10. Her internet service went down yesterday temporarily and she was messing around with the computer to get back online and somehow booted into the Windows Rescue Partition and began the Windows Restore process, then turned the computer off during the middle of the restore process.It's her only computer and she lives 1800 miles away. And since it's a netbook there's no optical drive.
When she boots up now, the netbook goes straight into Grub Rescue mode. I got her to try most of the commands for Grub Rescue, but most of them come back as "Unknown Command". The "LS" command works though, and she was able to get a list of partitions displayed.Does anyone know of some commands she could use try to boot back into 9.10 (assuming it's still there)? Or even boot into Windows? Specifically, is there a simple command that could be combined with "LS" to specify a partition and try to boot into it?
OpenSUSE 11.2 x86_64 KDE SC 4.4.3 Linux 2.6.34-rc6-29-desktop (from KERNEL:HEAD) HAL 0.5.13-4.2.1 udisks 1.0.0.git20100224-11.1 ASRock G43Twins-FullHD LGA 775 Intel G43 Micro ATX Intel Motherboard Samsung 22X DVDR DVD Burner Black SATA Model SH-S223Q (connected via SATA. detected as: /dev/sr0)
Discs are read by the drive when inserted (they are spun and the LED light on the drive lights up) but nothing happens after that.
I disconnected the SATA cable and tried a new SATA cable on a different SATA port and also tried a different SATA power cable but that did not fix anything.
I'm trying to mount an external DVD +RW Drive so I can burn a directory from my Linux Server to disk. I think I've figured out how to mount the drive, but it only works when there's a disk with data in the drive. When I enter mount /dev/scd1 /mnt I'm able to read from the drive, no problem. When I try to do the same thing, however, with a blank disk I get the following message: "mount: you must specify a filesystem type" So I'm assuming I need to prepare the disk somehow. I've verified that the dvd+rw-tools package is installed on the RH server but I'm not sure what the next step is.
My cdrom was sort of working, but the tray was physically damaged. The usb was working without a problem.
After replacing the the cdrom drive with a similar model known to work well I could not get it to mount. I then tried to move important files to usb to try a fresh install. The usb stick flickered when I put it in, but it didn't mount. Same behaviour as the cdrom, the light goes on when I turn on the computer, but once I'm logged in I can't access the cdrom.
I have tried multiple variations of playing with fstab and trying to mount things in terminal to no avail. I just can't get Ubuntu to recognize the usb or cdrom even though their lights go on when I first try to use them.
Finally got FC8 installed on new machine, and now it won't mount CDs/DVDs - didn't change anything in BIOS, CD/DVD drive is only thing on the IDE controller (HD is SATA) so is it likely a driver issue? FC8 seemed to have correct (or at least working) drivers for LAN, audio, SATA, etc.
I am trying to mount a a Magneto Optical WORM drive, mechanically it is a 2.6 Gb, 1024 Bytes/Sector, 5.25", Verbatim Media, The disk was created under OS-2.
I am using CentOS 5, and have tried mounting the disk as msdos and as vfat and get superblock errors among others.
what filesystem type did OS-2 use? is there an add on to CentOS that will support the filesystem?
I dont know when k3b stopped working but have just gone to burn a disk and when opening it tells me
Quote: No optical drive found. K3b did not find any optical device in your system. Solution: Make sure HAL daemon is running, it is used by K3b for finding devices.
I can boot from cd and can mount cds from within Slackware but for some reason k3b insists that i don't have a drive.
FC11 had "Authorization" choice in System > Preferences menu that we could change setting of system. but in Fedora 12 I don't have Authorization choice in menus. Now, how I can change setting of system? for example? Mount internal disk automatically!
Optical Out from my TV into the SPDIF / Optical In on my PC Optical Out from my PC into my Sony 5.1 Theatre Kit
The audio from the PC comes through ok when listening to music and movies. But unfortunately I can figure out how to enable the audio passthrough from my Tv so that the audio comes out of my theatre kit. In Sound Preferences, the hardware is set to 1 Output / 1 Input [Digital Stereo (IEC95 Output + Digital Stereo (IEC95 Input]. When I click on the audio tab, the Input Volume is at 100% and the Input Level is moving in conjunction with the audio coming from the Tv.
I saw it mentioned in another thread to install Gnome Alsa Mixer which I've done, it seeems to identify the audio chipset as Realtek ALC882, the motherboard is an Abit AB9 Pro. Hopefully I'm missing some config somewhere or there a box I should be ticking but I just can't find it.
One question: should F13 mount all attached USB devices after boot automatically? I guess it should. However, what I've experienced is that after boot and login, my USB modem + flash memory is not mounted. I need to manually unplug it and plug it again, and then it's mounted
I'm sorry for this stupid question, but I have nowhere found it.I need to access to my USB disc from text mode (In Fedora LiveCD I see it and i can access /media/New Volume). In F12 runlevel 3 in mc I see it in /dev/disc/by-label as @Newx20Volume. But I don't know what is the correct path.
Not sure if anyone uses floppy drives anymore much. I know that most machines don't come with them anymore unless you ask for one.One of my machines [Machine # 2] has a floppy and I have never had the occaision to use it under linux [opensuse 11.2 currently]. Until now that is! I have about 30 floppies that I need to transfer the data from. I am able to mount the floppy drive and take data off the currently inserted floppy, but if I want to insert another floppy and remove the data from it, I must unmount and remount the floppy everytime. There is an entry in fstab:
/dev/fd0 /media/floppy auto noauto,user 0 0
and a mount point in media [/media/floppy] Is there something else I need to have in the fstab line for the floppy so that it will read automatically everytime I insert a disk?
Is there any way I can prevent OpenOffice automatically installing when using the Alternate disc? I want to install a different package (LibreOffice 3.3) without having to uninstall Ubuntu's OpenOffice.
When I attach my ipod it gets automatically recognised and mounted to "/media/user's ipod". This is great but I would like to change the mount point to just "/media/ipod/" as it easier to use with gnupod (command driven ipod access oh yes!!) I've had a look around and I know how to mount devices but I'm at a lose as to how things in fedora are automatically mounted... I use gnome so from what I've read hal, dbus, and udev yeah? but I'm not sure what configuration files need to be changed. At the moment I'm just wanting to change the ipods mount point but I would like know more so any technical how-to or articles, or things to look at (I'm thinking X), to understand auto mounting would be nice too.
I am trying to setup fstab to automatically mount my NTFS partitions. I have used various Mount managers to create the entries in fstab. The fstab seems fine, but when mounting at boot or even via Nautilus I get the error message that I do not have permission to mount the disk.
1) Can this permission be set in the fstab file? If so what is the syntax of the fstab entry?
2) If not, is there a tool i.e. GUI to set the mount permissions?
I need a guicance related to mounting USB stick of 2GB capacity. Normally when I insert my USB stick it mount automatically and show me.I want that instead the usb mount automatically I manually mount it. Now there are two steps to do it. First How to stop USB to mount automatically ? Second How to mount it manually ?
With a 1Tb USB drive plugged in, we'll call it "TheDrive", I boot my machine and "TheDrive" is mounted automatically. The icon is on the desk-top. "TheDrive" mounts to /media/TheDrive. Everything is fine. But, I would like to automatically mount the drive in my file tree at the location /mnt/TheDrive. I would not like to have the drive automatically mounted to /media/ and appear on the desktop. I know that this requires the use of fstab; but, I do not know what to add to this file.
/dev/md0 (made from sda1 and sdb1) RAID1 /boot partition /dev/md1 (made from sda2, sdb2, and sdc2) RAID5 / partition
Earlier on I had some trouble with my sda drive, it dropped itself from both arrays, screwing up the mirroring of my two raid partitions participating in the /boot partition. I eventually got everything sorted out and back in sync. (I also have grub installed to MBR on both sda and sdb). Things are working fine regarding that, but since then I've had this issue:
During boot up, I'll get an error message that it could not mount my /boot partition (when fstab is set to either /dev/md0 or the UUID). It claims c9ab814c-47ea-492d-a3be-1eaa88d53477 does not exist!
My fstab:
Code:
[mark@mark-box ~]$ cat /etc/fstab # # /etc/fstab # Created by anaconda on Wed Jan 20 16:34:41 2010
[code]....
As far as I know, it isn't neccessary for /boot to be mounted always, correct? Although, as I understand, I need to have it mounted whenever making kernel changes correct?
I have AMD athlon 64 processor, Seagate 160GB SATA Hard Disk, ASUS A8VMX mother board.With this configuration, I can Install FC7 without any error. But all the latest releases after FC7 is not detecting my Hard disk. Is there any solution to solve this problem? Actually I'm searching for a solution when the FC8 released. Now I have all the later releases from FC8 to FC11 DVD except FC9. But none is working .
My wife's XP has crashed and I need to save files. I've discovered the command to mount the hard drive - unfortunately I need to force the mount, but I can't do it because I have to be in root. I can see the root user in the user list, but when I try to switch I can't access it. How I can do it to back up my wife's files. I have Kubuntu 8 and KDE 4.1.
Ubuntu 10.04 has just failed to load from my hard drive, so I've resorted to booting from CD just to get the machine going.I'm wondering if my main boot drive has gone caput??When trying to mount it using DISK UTILITY...get the message: Error mounting volume
Error mounting: mount: wrong fs type, bad option, bad superblock on /dev/sdb1,missing codepage or helper program, or other error.In some cases useful info is found in syslog - try dmesg | tail or so
I generally use Nero Linux for my optical disk authorization needs. But after installing Fedora I've noticed that Nero is not writing data in disks. It tried to make an .nrg image of the data in my hard disk. Then I tried k3b but seeing this error message:
MP3 Audio Decoder plugin not found. K3b could not load or find the MP3 decoder plugin. This means that you will not be able to create Audio CDs from MP3 files. Many Linux distributions do not include MP3 support for legal reasons.
Solution: To enable MP3 support, please install the MAD MP3 decoding library as well as the K3b MAD MP3 decoder plugin (the latter may already be installed but not functional due to the missing libmad). Some distributions allow installation of MP3 support via an online update tool. Installed libmad without success........
I have a strange problem with my DVD player. The problem: My device seems not to read any CD (it does read DVDs). Prologue: On a previous installation I had the same problem. But after messing up with that system I made a re-install, and the problem was gone. So I wasn't concerned about the problem any longer. That would be fine, but recently I had to make a new re-install to have space for windows. (I know, I'm a sinful man) But now the problem is there again. And it even is there under windows.
Question: In how far is the hardware damaged or is it a software problem since it once worked? Hardware data:
-Systems: Fedora 12 & Vista -Laptop: Dell Studio 1555 -Drive: Optiarc Model: DVD+-RW AD-7640S Rev: HD18
What I have been doing to fix the problem:
-I made an update of the firmware and bios with the files provided by dell -cleaned the lenses (with a clean disc) -checked log files (both windows and linux)
After setting udev to debug logging I received this
I have an annoying problem with Fedora 12. Sound works fine but When I restart the machine or log in it goes off again until I unset the IEC958 Optical Raw switch I have no sound. How do I get my fedora system to save this setting?