Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: 42.2 - How to mount USB device?

  1. #1

    Default 42.2 - How to mount USB device?

    I installed OpenSuse 42.2 (with btrfs) on one of my machines, which I use to store my audio library. I just bought a new player (SanDisk Clip Sport), and want to transfer the files to it. However, mounting seems to have drastically changed since 13.2. There I would just have a mount point in /etc/fstab, e.g.
    Code:
     /dev/sdb1       /media/FlashDisk     vfat    users,relatime,sync,exec,noauto  0 0
    and give the command "mount /media/FlashDisk".In 42.2, the format of fstab has changed. Each line (most of which don't seem to relate to actual devices :-() is prefixed by "UUID=long_hex_string". I don't see /var/log/messages any more (I sort of understand that), the journalctl command doesn't seem to show where the device is (it'd be sdb1 on 13.2). dmesg shows that the device is recognized.So I'm lost. How do I mount this device? (And other USB things in the future?)FYI, I do everything purely from the command line. No desktop, no file managers...PS: What is wrong with the editor here? All my paragraphs go away...

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,939
    Blog Entries
    2

    Default Re: 42.2 - How to mount USB device?

    Mounting can be done a number of different ways.

    Many people who are using a full Desktop (like Gnome or KDE) would probably use a File Manager (like Dolphin) which will mount discovered USB devices.

    Compared to 13.1, yes systemd is not far more capable and now might mount removable devices which are currently discovered by udev.
    But, I would think that <if> the removable storage is discovered in time, you can also mount in the fstab. Maybe you need to try a lazy mount? I'd have to either search for the specific post in these forums a few years ago that covered this fairly extensively if that is what you want to do...

    System messages are no longer stored in text files, they are stored in a database called the journal. You can either read the journalctl man pages or probably better is to skim any of the many articles and guides people have created that describe how to find things using the journalctl command.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,872

    Default Re: 42.2 - How to mount USB device?

    You can still use as pointer to the device things like /dev.sdb1. That other ways of identifying the device are also in use, does not mean that the old way dos not work anymore.

    Off course you must be sure that /dev/sdb belongs to the device you mean and that there a partition with #1 on it, else .ther will not be /dev/sdb1 (or it may point to another device).

    Check what device files you have with e.g.
    Code:
    ls -l /dev/sd*
    Henk van Velden

  4. #4

    Default Re: 42.2 - How to mount USB device?

    Quote Originally Posted by tsu2 View Post
    Compared to 13.1, yes systemd is not far more capable and now might mount removable devices which are currently discovered by udev.
    If it does automatically mount a device when I plug it in (it isn't often going to be there at boot), how do I find out where it's mounted? However, automounting is something that I would prefer not to happen. I want to mount the device when I issue the mount command, and have it unmounted when I issue umount.
    But, I would think that the removable storage is discovered in time, you can also mount in the fstab. Maybe you need to try a lazy mount? I'd have to either search for the specific post in these forums a few years ago that covered this fairly extensively if that is what you want to do...
    As I said, discovery by the system isn't really an issue. I know when I plug it in. I'd love to mount in fstab (or rather, define the mount point there), but the syntax of the file has changed so I don't know how to do it, or whether I can do it at all without messing up the system.I did of course try searching for relevant threads (and did a Google search) before posting this, but didn't find anything.

  5. #5
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,193
    Blog Entries
    1

    Default Re: 42.2 - How to mount USB device?

    Quote Originally Posted by jamesqf View Post
    If it does automatically mount a device when I plug it in (it isn't often going to be there at boot), how do I find out where it's mounted? However, automounting is something that I would prefer not to happen. I want to mount the device when I issue the mount command, and have it unmounted when I issue umount.
    Then adding an entry to /etc/fstab is the way to go. When such a mount exists here, it will be ignored by udisks2 (leaving you to mount manually). If you want to use mounting by UUID, an entry similar to the following can be used
    Code:
    UUID=XXXXXXXXXXXXXXX    /mnt/mydata ntfs  nofail,auto,noatime,rw,user    0   0
    Device UUIDs can be got using
    Code:
    ls -l /dev/disk/by-uuid
    or
    Code:
    blkid
    For more info read the following
    Code:
    man fstab
    This guide may be helpful to you as well
    https://wiki.archlinux.org/index.php/fstab

    As I said, discovery by the system isn't really an issue. I know when I plug it in. I'd love to mount in fstab (or rather, define the mount point there), but the syntax of the file has changed so I don't know how to do it, or whether I can do it at all without messing up the system.I did of course try searching for relevant threads (and did a Google search) before posting this, but didn't find anything.
    Henk answered this question already.

  6. #6
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    1,918

    Default Re: 42.2 - How to mount USB device?

    Quote Originally Posted by jamesqf View Post
    If it does automatically mount a device when I plug it in (it isn't often going to be there at boot), how do I find out where it's mounted? However, automounting is something that I would prefer not to happen. I want to mount the device when I issue the mount command, and have it unmounted when I issue umount. As I said, discovery by the system isn't really an issue. I know when I plug it in. I'd love to mount in fstab (or rather, define the mount point there), but the syntax of the file has changed so I don't know how to do it, or whether I can do it at all without messing up the system.I did of course try searching for relevant threads (and did a Google search) before posting this, but didn't find anything.
    As Henk pointed out the same fstab entry should work in 42.2 as long as /dev/sdb1 points to the partition you want to mount.
    Did you try using this approach?

    My preferred way of checking what is what is to use:
    Code:
    fdisk -l
    To check what is mounted where simply use:
    Code:
    mount
    Best regards,
    Greg

  7. #7

    Default Re: 42.2 - How to mount USB device?

    Quote Originally Posted by glistwan View Post
    As Henk pointed out the same fstab entry should work in 42.2 as long as /dev/sdb1 points to the partition you want to mount.
    So normal - AKA prior to 42.2 - fstab syntax will still work?
    Did you try using this approach?
    No, because I could just see the old syntax not being understood by the new OS, and terminally screwing up the system, requiring OS reinstall at a minimum. One of those "Been there, done that, don't need another T-shirt" things...
    ---Ignore this, it's the only way I can get a paragraph :-( ---
    I have gotten it to work by hand now, with some limitations (like having to be root to write to the device). Also it finds the device as sdf or sdg, not sdb. Anyway, thanks to everyone for the help.

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,872

    Default Re: 42.2 - How to mount USB device?

    I repeat:

    There is NO difference whatsoever between how fstab works in 42.2 or all versions before it. Compare
    Code:
    man fstab
    between the levels if you want so.

    When you have problems mounting something, then please show the mount statement and the eventual messages that follow it. Only then can we be of any help.

    When you have permission problems on the file tree within a mounted file system then there are two possibilities:
    • It is NOT a Linux file system type, thus has no owners/groups and permissions, thus they are mimicked (faked, or what ever you want to call that) and mount options for those non-Linux file systems are there to influence that mimicking into a workable situation.
    • It is a Linux file system type and in that case it is of no importance if it is on a different file system or not: the normal Unix/Linux ownership and permissions rules govern.

    In both cases, assessing what is wrong it of course enormous furthered by posting by what the owners and the permissions are of the files you have problems with
    Code:
    ls -l <file-name>
    (and of the directories in the path leading to the files) instead of saying things like "having to be root to write to the device" which are just conclusions you jumped to.
    Henk van Velden

  9. #9

    Default Re: 42.2 - How to mount USB device?

    Quote Originally Posted by hcvv View Post
    There is NO difference whatsoever between how fstab works in 42.2 or all versions before it.
    If there is no difference, then why does the fstab on my 42.2 machine have every line prefixed by "UUID=long_hex_string"? That is not the case on my 13.2 machine, nor on any *nix machine that I've ever looked at.
    When you have permission problems on the file tree within a mounted file system then there are two possibilities:
    Or perhaps a third possibility: it seems that the users option can only be specified from within fstab.

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,872

    Default Re: 42.2 - How to mount USB device?

    Quote Originally Posted by jamesqf View Post
    If there is no difference, then why does the fstab on my 42.2 machine have every line prefixed by "UUID=long_hex_string"? That is not the case on my 13.2 machine, nor on any *nix machine that I've ever looked at.
    That feature was not USED earlier (as default) by the openSUSE installer. That does NOT mean it did not exist earlier, nor does it mean that all other features (like using the /dev/sdNX directly) do not function anymore.

    As I read you complaint, you say that you can not use the /dev/sdNX way of specifying the device anymore (which is NOT the case), you say that you see another way of specifying the device used now by openSUSE. Which may be true, but is not very interesting for your case.

    It seems to me that you never ever took the trouble to study
    Code:
    man mount
    and
    Code:
    man fstab
    It is all there. In case you are still to lazy to look at it, this is an important (for your case) part of it man mount:
    The device indication.

    Most devices are indicated by a file name (of a block special device), like /dev/sda1, but there are other possibilities. For example, in the case of an NFS mount, device may look like knuth.cwi.nl:/dir. It is possible to indicate a block special device using its filesystem LABEL or UUID (see the -L and -U options below) and partition PARTUUID or PARTLABEL (partition identifiers are supported for GUID Partition Table (GPT) and MAC partition tables only).
    The recommended setup is to use tags (e.g. LABEL=<label>) rather than /dev/disk/by-{label,uuid,partuuid,partlabel} udev symlinks in the /etc/fstab file. The tags are more readable, robust and portable. The mount(8) command internally uses udev symlinks, so use the symlinks in /etc/fstab has no advantage over the tags. For more details see libblkid(3).
    and from man fstab:
    Instead of giving the device explicitly, one may indicate the filesystem that is to be mounted by its UUID or LABEL (cf. e2label(8) or xfs_admin(8)), writing LABEL=<label> or UUID=<uuid>, e.g., `LABEL=Boot' or `UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'.
    In short it says that there are three (3) ways to specify the device:
    1. by using the device file (/dev/sdNX)
    2. by using one of the symbolic links to the special device file created since ages (and used by opebSUSE as default in earlier versions) in the directories /dev/disk/by-label. /dev/disk/by-id, /dev/disk/by-path and /dev/disk/by-uuid
    3. by using the construct UUID=, LABEL=, etc.

    And you can choose from those three ways what fits you for each and every individual entry in fstab and for each and every individual mount


    Quote Originally Posted by jamesqf View Post
    Or perhaps a third possibility: it seems that the users option can only be specified from within fstab.
    I have no idea what you mean with that. A file system is a Linux file system (in fact POSIX complying) or not. There is no third possibility.

    users is a File System Independent Mount Option:
    users
    Allow every user to mount and unmount the filesystem. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line users,exec,dev,suid).
    This does not have ANYTHING to do with permissions to access files on the mounted file system. When this is specified in fstab, It makes it possible that any user can execute the mount command for that fstab entry. The result will be the same as when root executes the mount command. And it can of course only be in fstab and not added when using the mount command. The latter would mean that every user could (un)mount every file system at will.

    Maybe instead of clinging to some conclusions you have come to by your experiences, you better try to reformulate your problem.
    In your first post you show us an fstab entry (which looks fine, but it depends on that device being /dev/sdb1, which you do not prove). Then you say you give a command, but you do NOT show us that copied/pasted from the terminal, icluding the prompt, the command, the output (any error messages?) and the next prompt (and best something like mount | grep sdb1 before and after to show if something happened). Thus we have no idea if that succeeds or goes wrong or whatever. Instead you start talking about other entries in your fstab, which has nothing to do with your problem (if you have one).
    Henk van Velden

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •