You are not logged in.
Pages: 1
I am about six months new to Linux; I have installed my first arch system but not yet installed a desktop environment. I am trying to mount a USB flash drive from the shell but I am not having much luck. I have tried following the instructions in the archwiki, http://wiki.archlinux.org/index.php/USB_Storage_Devices. I am having a problem with the following command:
mount -t vfat /dev/sda1 /mnt/usbstickI get an error message saying that the mount point does not exist. I have in the /mnt directory the following:
cd cdrom dvd fd0 f1(I am not sure what fd0 and fl are, if somebody could please tell me I would appreciate it. Also I do not have a DVD-ROM on my computer is the dvd listed by default or do I have a package installed I do not need?) I did some searching online and came across the following site, http://linuxcommando.blogspot.com/2007/ … -from.html. I followed the instructions to identify the correct partition name corresponding to the USB drive by running the following command:
grep SCSI /var/log/messages.logand I get the following results:
Dec 30 22:16:17 morgan-desktop scsi2 : SCSI emulation for USB Mass Storage divices
Dec 30 22:16:22 morgan-desktop sd 2:0:0:0: [sdb] Attached SCSI removable diskThe next steps in the instructions are to mount the partition to the existing mount point (directory) by using the following command.
mkdir -p /mnt/myusb
mount -t vfat -o rw,users /dev/sda1 /mnt/myusbThis is where I am having a problem, I do not understand the results and how to proceed to the next step, please help me.
One other small question what is the best command to shut down the computer as a normal user?
Thank you
Morgan Smith
Offline
The directories in /mnt are not used by the system - you can do what you like with them, including deleting them.
Normally (?) the device /dev/sda will be your hard drive. Please post the output of 'df' and 'fdisk -l' (with the usb device plugged in).
To shut down from the console, 'halt' is quite an easy one ('reboot' to reboot), but to make this work for a normal user I think you have to do 'chmod u+s /sbin/halt' as root, to set the SETUID property. Desktop environments (KDE,gnome,xfce) have their own shutdown facilities.
larch: http://larch.berlios.de
Offline
First to your last question:
There are several ways. When I'm not in X I'll usually use 'sudo poweroff', but this of course requires a working sudo setup and about that alone you could write books. 'su -c poweroff' works of course, too, but then you'll still have to enter the root password.
The most elegant way (in my opinion) is to add your user to the power group (gpasswd -a youruser power) and let HAL (needs to enabled in rc.conf DAEMONS) handle it behind the scenes, for example when you use the Xfce desktop and click the shutdown button.
About the USB stick:
I'd advise the use of pmount. You probably need to install it first (pacman -S pmount) but it's more flexible than plain 'mount'.
The latter either requires you to first define a static mountpoint in /etc/fstab (which would interfere with HAL -> no nice little icons popping up for your disk/stick once you got a DE) or to always write a long command like 'mount -t vfat -o uid=1000,umask=000 /dev/sdb1 /mnt/usb' which also requires root privileges.
pmount allows you to mount partitions with your normal user by just giving it a device name, like 'pmount /dev/sdb1' or 'pmount /dev/disk/by-label/UsbStick'. If you need to figure out the exact device name, look at dmesg output again. You should see a line like "sdb: sdb1" below the output you already pasted. If you don't get an error you can then access the contents somewhere in /media.
I hate sigs. This one only exists to remind myself to get an avatar.
Offline
Look at your /dev dir
issue dir before you plug the usb stick and after you've plugged it and loaded the module usb_storage.
The extra device that would appear (it is not necessary that the device for your usb stick is sda1 -> it depends on every system. For example when I used to run two hdds my first usb stick was /dev/sdc1 and my second was /dev/sdd1. Now that I use only one hdd my usb stick is /dev/sdb1 and my second - /dev/sdc1)
My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...
Offline
Unless I am missing something, your first command should work just fine, but you need to create the usbstick directory under /mnt. If the directory does not exist, then mount gives you that error you received while trying to mount the drive.
In general, you can mount anything under any directory (theoretically speaking if you have the rights to the directory), provided the directory exists.
Offline
Ok, Lots of different advice here, let's see if I can explain it all together, and clear up a few bits...
I'll try to explain why I'm saying what I am, it doesn't matter if you don't follow it all, commands are below.
You are on the right lines here, but a few things missing. Firstly, to mount the USB stick you are using the correct command, but the locations are a problem. The command is "mount -t type what/to/mount where/to/mount". You can find out more about the mount command with "mount --help" or "man mount"
You have correctly identified type as vfat - this means the pen is formated as FAT.
To find out what to mount, you can check /var/log/messages.log, the second command you posted searches trough that file and prints out lines including the phrase SCSI, and the result tells you that a usb storage device had been attached as sdb, so the correct device is /dev/sdb1. Storage devices are named sda sdb sdc etc in the order they are attached, and the numbers refer to the partitions on the disk.
You can mount it anywhere you want, as any existing directory, but the one you tried to use /mnt/usbstick doesn't exist, so create it, using mkdir.
The commands you need therefore are:
mkdir /mnt/usbstick
mount -t vfat /dev/sdb1 /mnt/usbstickThis will work as root. There is also, as byte said, a program called pmount (which you can get with pacman -S pmount) which works the same way for a standard user.
Finally, there are also a number of tools like HAL which can be used to automate the process.
As for shutting down, as has been said you must be root or in the power group, then you can use 'halt' 'poweroff' 'reboot' or 'shutdown'. All have slightly different effects, and poweroff is probably the easiest.
Hope this helps
Jack
Offline
Offline
I would like to thank everyone for your help; I now have it sorted out. My biggest stumbling point was that I did not understand that the directories in /mnt are just simply directories and not directly related to physical devices, and that "usbstick" and "myusb" are just names that the user creates.
Also to find out what/to/mount I found the following command useful:
fdisk –lIts output made a lot more sense to me than the message.log.
Happy New year everyone
Morgan Smith
Offline
as a healthy tip for future adventures:
when you would like to mount a device permanently, but unsure what options to use in fstab, plug it in and
cat /etc/mtabor
cat /proc/mounts![]()
I need real, proper pen and paper for this.
Offline
Hello Fellow Archers!
Rather than starting a new topic I thought I would continue this one since it seems to relate closely to my problem. I had stopped using Arch some months ago (various problems with new versions not running with my somewhat older hardware), but (because Arch was my favorite) I tried again last December and was very happy to find that it now works (except for my problem).
The problem: I plug in any USB stick and find that NO new device (such as /dev/sdc1) gets created. The only thing that changes in /dev is that three new entries appear, such as:
usbdev5.5_ep00
usbdev5.5_ep02
usbdev5.5_ep81but NOTHING else is created in /dev ![]()
Obviously, I cannot mount my usb-sticks using for example /dev/sbcx (which is what I do in other distros and previously did in Arch). The output from "fdisk -l" after plugging in the stick shows the same thing as before plugging.
I've searched the forum quite a bit and have yet to find an answer. Any ideas??
BTW: I'm using fluxbox and do not need to have any icons popping up on my desktop after plugging in and mounting (and I also do not require automounting, although that would be nice -- I can live with mounting via the CLI, if I could only get that far!). Also the output from dmesg after plugging in the stick looks (for example) like this:
usb 5-3: new high speed USB device using ehci_hcd and address 2
usb 5-3: configuration #1 chosen from 1 choiceand that's it !!! Other distros continue and mention sdc and sdc1 being assigned or whatever. What's going on here?
Thanks in advance,
-- Dr. U
Offline
Hi, Archers!
After reading more postings I came across the tip of inserting my USB stick and then typing (as root)
tail /var/log/messages.logwhich gave me the advice that solved my problem mentioned in my previous posting. In my efforts to speed up booting I have changed /etc/rc.conf to no longer auto-load modules (but booting still takes 45-50 sec) and manually inserted the modules that I found after running
hwdetect --modulesinto the modules list (and putting a "!" in front of several I do not need).
To make a long story short, the messages.log output said that since auto-loading had been disabled that it (or whoever is writing this stuff to the log) was not even going to think about loading the modules usb_storage, usbcore and ide_core! So I cleverly added these to the rc.conf modules list, rebooted (not sure if that was needed, but I and my box both survived it...) and ... now my USB sticks are automatically mounted in /media !!! ![]()
Thanks to the experts out there who provide such tips (even if this one was provided to someone else)! ![]()
Regards,
-- Dr. U
Offline
yes, that is udev being angry.
I need real, proper pen and paper for this.
Offline
Pages: 1