DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st May 2008
corneliu corneliu is offline
Port Guard
 
Join Date: May 2008
Posts: 19
Default mounting/unmounting CD and USBkey

Hi guys,
I've got FreeBSD + KDE.
Currently I mount the CD with the following command
Code:
mount -t cd9660 /dev/acd1 /mnt/cd
and the USBkey with
Code:
mount -t msdosfs /dev/da0s1 /mnt/flash
I have searched the forums and the Internet but couldn't find away to unmount these devices. If I just eject/unplug the devices I can't remount them by using the commands that I mentioned earlier.
Is there a way to mount/unmount the CD drive and the USBkey so I can remount them without having to reboot?
Thanks in advance,
Corneliu
Reply With Quote
  #2   (View Single Post)  
Old 21st May 2008
corey_james corey_james is offline
Uber Geek
 
Join Date: Apr 2008
Location: Brisbane, Australia
Posts: 238
Default

umount <device_name>
or
umount <mount_path>
Reply With Quote
  #3   (View Single Post)  
Old 21st May 2008
windependence's Avatar
windependence windependence is offline
Real Name: Tim
Shell Scout
 
Join Date: May 2008
Location: Phoenix, Arizona
Posts: 116
Default

If you get a "device busy" you might have to do a

umount -l <device>

-Tim
__________________
www.windependence.org
Get your Windependence today!
Reply With Quote
  #4   (View Single Post)  
Old 21st May 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

If you get a "device busy" message, it means you're probably active in the devices mount point.. change to a different directory and ensure no other process is read/writing/accessing files on the drive.
Reply With Quote
  #5   (View Single Post)  
Old 21st May 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Default

You may want to set-up KDE so it will automatically mount and unmount your CDs / media. Have a look at this How-To.
Reply With Quote
  #6   (View Single Post)  
Old 22nd May 2008
corneliu corneliu is offline
Port Guard
 
Join Date: May 2008
Posts: 19
Default

Thank you all.
When I try to unmount this is what I get:
Code:
freebsd# unmount -l /dev/da0s1
unmount: Command not found.
freebsd#
I guess I'm missing a package.
I tried the tutorial to automount but I didn't succeed. I followed all the steps and everything seemed fine. Still no automounting...
Reply With Quote
  #7   (View Single Post)  
Old 22nd May 2008
corneliu corneliu is offline
Port Guard
 
Join Date: May 2008
Posts: 19
Default

The tutorial for mounting stuff automatically.
Here is what I did:
Code:
freebsd# find `kde-config --prefix`/lib/kde3/media_propsdlgplugin.so && echo "HAL is enabled."
/usr/local/lib/kde3/media_propsdlgplugin.so
HAL is enabled.
freebsd#
So HAL is enabled...
Code:
freebsd# vi /etc/devfs.rules

#MYBOX's rules
#
[mybox_rules=100]
add path 'acd0' mode 666
add path 'cd0' mode 666
~
/etc/devfs.rules: 6 lines, 85 characters.
freebsd#
Here I figured I had to replace the * with 0
Not sure it is OK...
Code:
freebsd# vi /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad4s1b             none            swap    sw              0       0
/dev/ad4s1a             /               ufs     rw              1       1
/dev/ad4s1e             /tmp            ufs     rw              2       2
/dev/ad4s1f             /usr            ufs     rw              2       2
/dev/ad4s1d             /var            ufs     rw              2       2

~
/etc/fstab: unmodified: line 1
Code:
freebsd# vi /etc/rc.conf

# -- sysinstall generated deltas -- # Mon May 19 22:21:55 2008
# Created: Mon May 19 22:21:55 2008
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="freebsd.gateway.2wire.net"
ifconfig_rl0="DHCP"
ipv6_enable="YES"
keymap="us.iso"
linux_enable="YES"
defaultrouter="192.168.2.1"
devfs_system_ruleset="mybox_rules"
dbus_enable="YES"
hald_enable="YES"
~
/etc/rc.conf: unmodified: line 1
Code:
freebsd# vi /usr/local/etc/PolicyKit/PolicyKit.conf
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
    <match user="root">
        <return result="yes"/>
    </match>
    <match action="org.freedesktop.hal.storage.mount-removable">
      <match user="corneliu">
        <return result="yes"/>
      </match>
    </match>
</config>
~
~
~
~
~
~
/usr/local/etc/PolicyKit/PolicyKit.conf: unmodified: line 1
Reply With Quote
  #8   (View Single Post)  
Old 22nd May 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

The command is "umount" not "unmount", pay extra attention.. type in commands exactly as you see them.
Reply With Quote
  #9   (View Single Post)  
Old 22nd May 2008
corneliu corneliu is offline
Port Guard
 
Join Date: May 2008
Posts: 19
Default

Quote:
Originally Posted by BSDfan666 View Post
The command is "umount" not "unmount", pay extra attention.. type in commands exactly as you see them.
Thanks, sorry
Reply With Quote
Old 22nd May 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Default

Quote:
Originally Posted by corneliu View Post
The tutorial for mounting stuff automatically.
Here is what I did:
Code:
freebsd# find `kde-config --prefix`/lib/kde3/media_propsdlgplugin.so && echo "HAL is enabled."
/usr/local/lib/kde3/media_propsdlgplugin.so
HAL is enabled.freebsd#
So HAL is enabled...
OK.
Quote:
Originally Posted by corneliu View Post
Code:
freebsd# vi /etc/devfs.rules

#MYBOX's rules
#
[mybox_rules=100]
add path 'acd0' mode 666
add path 'cd0' mode 666
~
/etc/devfs.rules: 6 lines, 85 characters.
freebsd#
Here I figured I had to replace the * with 0
Not sure it is OK...
You don't have to replace the "*". It is useful to keep it like that for multiple drives, but you can specify a single drive like you did.

Also, did you make yourself a member of the operator group?
Quote:
Originally Posted by corneliu View Post
Code:
freebsd# vi /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad4s1b             none            swap    sw              0       0
/dev/ad4s1a             /               ufs     rw              1       1
/dev/ad4s1e             /tmp            ufs     rw              2       2
/dev/ad4s1f             /usr            ufs     rw              2       2
/dev/ad4s1d             /var            ufs     rw              2       2

~
/etc/fstab: unmodified: line 1
OK.
Quote:
Originally Posted by corneliu View Post
Code:
freebsd# vi /etc/rc.conf

# -- sysinstall generated deltas -- # Mon May 19 22:21:55 2008
# Created: Mon May 19 22:21:55 2008
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="freebsd.gateway.2wire.net"
ifconfig_rl0="DHCP"
ipv6_enable="YES"
keymap="us.iso"
linux_enable="YES"
defaultrouter="192.168.2.1"
devfs_system_ruleset="mybox_rules"
dbus_enable="YES"
hald_enable="YES"
~
/etc/rc.conf: unmodified: line 1
OK. Did you (re)start dbus and hald in that order?
Quote:
Originally Posted by corneliu View Post
Code:
freebsd# vi /usr/local/etc/PolicyKit/PolicyKit.conf
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
    <match user="root">
        <return result="yes"/>
    </match>
    <match action="org.freedesktop.hal.storage.mount-removable">
      <match user="corneliu">
        <return result="yes"/>
      </match>
    </match>
</config>
~
~
~
~
~
~
/usr/local/etc/PolicyKit/PolicyKit.conf: unmodified: line 1
OK.

That's pretty much it. You need to restart KDE of course after doing all of this. If it still isn't working, post exactly what happens when you insert a CD. Any error messages, etc. Also, if you mounted the CD somewhere manually you must unmount it first before automounting can happen.
Reply With Quote
Old 24th May 2008
corneliu corneliu is offline
Port Guard
 
Join Date: May 2008
Posts: 19
Default

Thank you all,
Trying to set the auto-mount I messed up the system so I had to reinstall FreeBSD. The umount command works great, so I'll stick with it for a while untill I get the courrage to try the auto-mount stuff again.
Reply With Quote
Old 28th May 2008
davidgurvich davidgurvich is offline
Fdisk Soldier
 
Join Date: May 2008
Location: NYC
Posts: 57
Default

I tried using the howto and have a problem with policykit. I believe that all the required daemons are running and properly installed. However, I cannot automount as a regular user. The following is definitely not recommended, but should indicate where the problem lies. Replacing
Code:
    <match action="org.freedesktop.hal.storage.mount-removable">
      <match user="corneliu">
        <return result="yes"/>
      </match>
    </match>
with
Code:
      <match user="corneliu">
        <return result="yes"/>
      </match>
allows automounting. I do not like the privileges granted, but it may be acceptable for a laptop with no external services.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting external XFS HDD rativid OpenBSD General 5 3rd September 2010 02:31 PM
USB icon after mounting andycapp FreeBSD General 0 23rd October 2008 10:40 PM
Mounting sniper007 FreeBSD General 7 2nd July 2008 06:50 AM
mounting UFS hirohitosan Other BSD and UNIX/UNIX-like 2 27th June 2008 02:40 PM
Mounting a second serial hd keyboard112 Other BSD and UNIX/UNIX-like 4 12th May 2008 08:06 AM


All times are GMT. The time now is 09:46 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick