LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Manually Mount a USB Stick in Console (No X Running) (https://www.linuxquestions.org/questions/slackware-14/manually-mount-a-usb-stick-in-console-no-x-running-844186/)

tronayne 11-14-2010 07:27 AM

Manually Mount a USB Stick in Console (No X Running)
 
I'd like to be able to manually mount a USB stick in console (before X is started) and I can't seem to find a good way to do that. I'm not too smart about HAL and UDEV and I don't want to undo the auto mount feature when X is running but still be able to manually mount and unmount as necessary; like for installing patches and packages after an install or version upgrade. It seems like there should be an entry in /etc/fstab and a directory in /mnt or /media but danged if I can find something that points the way.

Can anyone suggest a good, solid, dependable method for doing this?

allend 11-14-2010 07:50 AM

Have you tried plugging the stick and then looking at the output of 'dmesg | tail' to see a dev name like sdb1, then, as root, 'mount /dev/sdb1 /mnt/tmp'?

tronayne 11-14-2010 08:23 AM

Well, nope, hadn't tried that -- but, hey, it works (and now all I have to do is remember it, eh).

Thanks.

Nylex 11-14-2010 08:27 AM

Writing udev rules for your devices would be a good idea, too. Doing so allows you to have more meaningful device names than, e.g. "/dev/sdc".

piratesmack 11-14-2010 08:41 AM

Slackware also comes with a tool called 'exo-mount' that does it with hal
http://www.slackwiki.org/Mount_with_...m_command_line

w1k0 11-14-2010 09:05 AM

tronayne,

In fact you haven’t remember that command. Instead of that make a separate directory for the USB devices with the command:

mkdir /mnt/usb

and add the following line to /etc/fstab:

Code:

/dev/sdb1      /mnt/usb        vfat    user,noauto,umask=000    0  0
In result it’ll be enough to use the command mount /mnt/usb to mount the device and the command umount /mnt/usb to unmount it.

tronayne 11-14-2010 10:20 AM

Thanks to all for all the above.

The /etc/fstab entry, however, seems to most practical (given that I've got about 10 of these things, different manufacturers, different sizes, heck, even different colors) as a general-purpose, mount the blasted thing, let me do what I need to, unmount it and get on with other things. The automagic mount-to-file-manager when X is running does it's thing and this manual method for pre-startx pretty much covers all the bases.

Thanks again.

w1k0 11-14-2010 10:27 AM

tronayne,

I'm sure it's possible to disable automount feature in X Window and use manual mounting in your desktop environment or window manager.

tronayne 11-14-2010 10:36 AM

Quote:

Originally Posted by w1k0 (Post 4158494)
I'm sure it's possible to disable automount feature in X Window and use manual mounting in your desktop environment or window manager.

Yeah, I know that's doable but it's not for my servers -- a friends' system needs to go from 13.0 to 13.1 and has had some problems with KDE simply freezing (which is why it went back to 13.0); I'm somewhat sure that the problem is associated with the Radeon board and open-source drivers (which I'm going to shut off in the BIOS and see what happens). Just need to do all the patching before starting X (and couldn't remember how to mount a stick, getting old is... uh, I forget what it is...).

Anyway, all is well that ends.

Thanks.

dugan 11-14-2010 10:41 AM

Quote:

Originally Posted by allend (Post 4158371)
Have you tried plugging the stick and then looking at the output of 'dmesg | tail' to see a dev name like sdb1, then, as root, 'mount /dev/sdb1 /mnt/tmp'?

As an alternative to dmesg | tail, you can also run fdisk -l as root to get the device name.

w1k0 11-14-2010 04:05 PM

I had some specific problem concerning Radeon graphics card (it freezed when I used Midnight Commander within the second X Window session started with startx -- :1). I solved that problem by generating xorg.conf with X -configure command and adding to the section Device two following lines:

Code:

        Option      "AccelMethod" "EXA"
        Option      "MigrationHeuristic" "greedy"

Your friend's problem is probably different than mine but it's worth to try that method.

serviteursociale 11-14-2010 04:48 PM

Mount by label
 
Hi, in addition to the fstab method mentioned earlier, you could also try mounting by label instead of the device name, if its partition is labelled; I do this frequently with my system because I can never quite predict the order devices will be picked up in. At a terminal you could (as root of course) do this:
#mount -L <label here> -o <options here> <mount point here>

Or, if you want to use fstab, you could try:
LABEL=<label here> <mount point here> <fs type here> <options here> <dump> <fsck>

tronayne 11-15-2010 07:48 AM

Quote:

Originally Posted by w1k0 (Post 4158750)
I had some specific problem concerning Radeon graphics card ... I solved that problem by generating xorg.conf with X -configure command and adding to the section Device two following lines:
Code:

        Option      "AccelMethod" "EXA"
        Option      "MigrationHeuristic" "greedy"


Hey, thanks for that, I'll give it a try.

There seems to be a common thread of problems with Radeon cards (and, perhaps, with the open source drivers). I have gotten the drivers from AMD and will try installing those on the next go-round. If they work, problem solved and on to other things; if they don't, I'll give the above a try before I disable/remove/kill the Radeon card and rely on the built-in Intel controller (they don't do anything that requires a super-jazzy graphic controller anyway, so...).

I have added an XP guest in VirtualBox. That has had "crazy colors" or "reverse image" or whatever you call it whenever VirtualBox is started (not the virtual machine but the reset of display). That particular problem seems associated with Radeon cards and a fix is to add
Code:

Section "Extensions"
        Option  "Composite" "Disable"
EndSection

to xorg.conf. Yes, it's a kludge but it's a kludge that works.

So, I'll try your kludge too and, maybe, problem goes away without tearing the box apart.

Thanks again.


All times are GMT -5. The time now is 04:09 PM.