Announcement

Collapse
No announcement yet.

Persistent/Static usb mount point

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Persistent/Static usb mount point

    This is under Experimentation/Customization/Optimization > Topic: Rules for posting in this forum


    Links

    "Sources of Information"
    > HOWTO find Kubuntu's manual / reference / guide / documentation / help

    About USB
    > Mount USB
    > Rename USB Drive
    > askubuntu.com: Mounting a usb disk in a permanent location

    Misc
    > Using UUID
    > Mount Devices Troubleshooting
    > How to fstab
    > File Permissions
    > Chmod help


    MANuals

    man udev:
    NAME
    udev - Linux dynamic device management

    DESCRIPTION
    udev supplies the system software with device events, manages permissions of device nodes and may create
    additional symlinks in the /dev directory, or renames network interfaces. The kernel usually just assigns
    unpredictable device names based on the order of discovery. Meaningful symlinks or network device names
    provide a way to reliably identify devices based on their properties or current configuration...

    man udevadm:
    NAME
    udevadm - udev management tool

    DESCRIPTION
    udevadm expects a command and command specific options. It controls the runtime behavior of udev, requests
    kernel events, manages the event queue, and provides simple debugging mechanisms...

    README

    /etc/udev/rules.d/README:
    The files in this directory are read by udev(7) and used when events
    are performed by the kernel. The udev daemon watches this directory
    with inotify so that changes to these files are automatically picked
    up, for this reason they must be files and not symlinks to another
    location as in the case in Debian.

    Packages do not generally install rules here, this directory is for
    local rules. If you want to override behaviour of package-supplied
    rules, which can be found in /lib/udev/rules.d, you can do one of
    two things:...
    /lib/udev/rules.d/README:
    The files in this directory are read by udev(7) and used when events
    are performed by the kernel. The udev daemon watches this directory
    with inotify so that changes to these files are automatically picked
    up, for this reason they must be files and not symlinks to another
    location as in the case in Debian.

    These are not conffiles. If you want to override the behaviour, you
    can do one of two things:...

    D Directories

    Rule of thumb

    Don't edit (mess) the original setting files if possible - use the separate additional (d directory) files.

    There are - among others:

    SOURCES.LIST.D:
    The /etc/apt/sources.list.d directory provides a way to add sources.list entries in separate files. The
    format is the same as for the regular sources.list file. File names need to end with .list and may only
    contain letters (a-z and A-Z), digits (0-9), underscore (_), hyphen (-) and period (.) characters. Otherwise they will be silently ignored
    > /etc/sudoers.d/ (and all those d directories)
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    #2
    Re: Persistent/Static usb mount point

    You may or may not be aware of the following but I cannot comment on their validity for *buntu.

    https://wiki.archlinux.org/index.php...ries_with_udev

    https://wiki.archlinux.org/index.php/Udev
    Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

    Comment


      #3
      Re: Persistent/Static usb mount point

      Example
      (This is a way to do it, not the only way to do it)


      The standard mount point is (at here):

      Kubuntu 10.10
      (the Maverick is using the Hal)

      1) Label (/media/Blade01, /media/Lexar01, ...etc).
      2) If there is not the label info the usb stick is mounted under the "disk" (/media/disk).


      Kubuntu 11.04 (alpha2)
      (the Natty is using the UDisk > Udisks/Upower replacing HAL)

      1) Label
      2) If there is not the label info the usb stick is mounted under the uuid (/media/4830-E440/, etc).



      Persistent mount:

      1)
      Inserting a usb stick to the Kubuntu - reading the information with the command:
      Code:
      udevadm info --query=all -n /dev/sde
      P: /devices/pci0000:00/0000:00:02.2/usb1/1-1/1-1:1.0/host4/target4:0:0/4:0:0:0/block/sde
      N: sde
      S: block/8:64
      S: disk/by-id/usb-SanDisk_Cruzer_Blade_20051738331606211E7D-0:0
      S: disk/by-path/pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0
      E: UDEV_LOG=3
      E: DEVPATH=/devices/pci0000:00/0000:00:02.2/usb1/1-1/1-1:1.0/host4/target4:0:0/4:0:0:0/block/sde
      E: SUBSYSTEM=block
      E: DEVNAME=sde
      E: ID_VENDOR=SanDisk
      E: ID_VENDOR_ENC=SanDisk\x20
      E: ID_VENDOR_ID=0781
      E: ID_MODEL=Cruzer_Blade
      E: ID_MODEL_ENC=Cruzer\x20Blade\x20\x20\x20\x20
      E: ID_MODEL_ID=5567
      E: ID_REVISION=1.00
      E: ID_SERIAL=SanDisk_Cruzer_Blade_20051738331606211E7 D-0:0
      E: ID_SERIAL_SHORT=20051738331606211E7D
      E: ID_TYPE=disk
      E: ID_INSTANCE=0:0
      E: ID_BUS=usb
      E: ID_USB_INTERFACES=:080650:
      E: ID_USB_INTERFACE_NUM=00
      E: ID_USB_DRIVER=usb-storage
      E: ID_PATH=pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0
      E: ID_PART_TABLE_TYPE=dos
      E: UDISKS_PRESENTATION_NOPOLICY=0
      E: UDISKS_PARTITION_TABLE=1
      E: UDISKS_PARTITION_TABLE_SCHEME=mbr
      E: UDISKS_PARTITION_TABLE_COUNT=1
      E: MAJOR=8
      E: MINOR=64
      E: DEVTYPE=disk
      E: DEVLINKS=/dev/block/8:64 /dev/disk/by-id/usb-SanDisk_Cruzer_Blade_20051738331606211E7D-0:0 /dev/disk/by-path/pci-0000:00:02.2-usb-0:1:1.0-scsi-0:0:0:0
      2)
      Picking the serial number /1/ (E: ID_SERIAL_SHORT=20051738331606211E7D). Writing a simple udev rule:

      /etc/udev/rules.d/99-persistent-usb.rules:
      Code:
      BUS=="usb", ENV{ID_SERIAL_SHORT}=="20051738331606211E7D", SYMLINK+="rog131-persistent-usb-mount"
      When the usb stick with the serial number "20051738331606211E7D" is inserted the device symlink to the device is made:
      :~$ ls -l /dev/rog*
      lrwxrwxrwx 1 root root 3 2011-02-15 15:06 /dev/rog131-persistent-usb-mount -> sde
      3)
      Adding the information to the /etc/fstab:
      # USB exeption/persistent/static mount point
      /dev/rog131-persistent-usb-mount /media/my-special-usb-mount-point auto user,noauto,exec,utf8 0 0
      4)
      Making the mount point:
      Code:
      sudo mkdir -p /media/my-special-usb-mount-point
      Setting the write/read/execute rights:
      Code:
      sudo chmod 777 /media/my-special-usb-mount-point
      5)
      Reboot (or sudo mount -a etc)

      After the reboot. The usb stick (20051738331606211E7D) is mounted to the /media/my-special-usb-mount-point when the action "Open with File Manager" is clicked.



      [img width=400 height=259]http://img228.imageshack.us/img228/1313/dolphinwithmountpoint.png[/img]


      The device name is read from the "Label" if set.




      /1/ The uuid could change with every format. The device serial number should not.

      (blkid->format->blkid->...)
      /dev/sde1: LABEL="LEXAR01" UUID="2FE8-1275" TYPE="vfat"
      /dev/sde1: LABEL="Lexar01" UUID="2F510DA2265BDE22" TYPE="ntfs"
      /dev/sde1: LABEL="Lexar01" UUID="2fc25ade-0ce4-4827-8732-f33a84a14c99" TYPE="ext4"
      ...
      /dev/sde1: LABEL="LEXAR01" UUID="4830-E440" TYPE="vfat"
      Before you edit, BACKUP !

      Why there are dead links ?
      1. Thread: Please explain how to access old kubuntu forum posts
      2. Thread: Lost Information

      Comment


        #4
        Re: Persistent/Static usb mount point

        You may or may not be aware of the following...
        Yes, thank you. The > askubuntu.com: Mounting a usb disk in a permanent location has sublinks. One of them is https://wiki.archlinux.org/index.php/Udev.

        More links are always wellcomed.

        Before you edit, BACKUP !

        Why there are dead links ?
        1. Thread: Please explain how to access old kubuntu forum posts
        2. Thread: Lost Information

        Comment


          #5
          Re: Persistent/Static usb mount point

          Very nice writeup Rog -- thank you.

          Comment

          Working...
          X