Help on linux file transfer

panicmoment

Distinguished
Mar 6, 2011
6
0
18,510
Hello, how can i detect a usb in linux command line? please list all the possible scrips to detect it or command to see. and how to mount it? I need it for the project that compresses a file and at the same time saving it on a usb. i can't use sudo because it is restricted by our root account, so she advices me to use ftp to transfer the file compressed.
 

chamaecyparis

Distinguished
Nov 21, 2010
321
0
18,810
 

panicmoment

Distinguished
Mar 6, 2011
6
0
18,510
Thank you for the answer! I have done that already looking in dev directory. Even checked it with the command df. I typed df and it shows the connected devices and then I plug in the USB and typed df again. but nothing changes. BTW, access the linux command line with the use of telnet or PuTTy with a server. I really can figure it how to detect the device. And I can't test it here in my home because I can't access the server that we are using.

Sorry for my english, please bear with it. Thank you again!
 

someone19

Distinguished
Jan 16, 2011
441
3
18,810
df shows you useage of mounted filesystems. After you plug in your device type the command dmesg as root and the last few lines will tell you how the device has been detected and named /dev/sd?

Then you need to mount the drive to a point in your filesystem - ie:

mount /dev/sd? /mnt/usb

you'll need to see the output of dmesg (its huge, but if you issue the command 15-30 seconds after plugging in the last handful of lines are all we're interested in) You will also have to create the directory /mnt/usb (or whatever other directory you want to mount the drive to).
 

panicmoment

Distinguished
Mar 6, 2011
6
0
18,510


Thank you!

But in our class we are restricted to log in as root or even use sudo. :(
and I can't mount the usb because of two reasons; I don't have the permission to mount and I can't detect the USB. sorry, im still a noob at this things.

Thank you for the advice!
 

someone19

Distinguished
Jan 16, 2011
441
3
18,810
If your a member of the plugdev group than you will be able to run the mount command, if not then I think we're stuck.

Fortunately, linux is a very secure system, unfortunately its a very secure system.

To be able to access the USB, it needs to be mounted.
 

panicmoment

Distinguished
Mar 6, 2011
6
0
18,510


Thank you for the reply!

How can i know if I am a member of the plugdev group? any commands to check it? sorry, im a noob. :??:

Supposed I'm a member of the plugdev group. how can I run the mound command without being an superuser or root. Thank you ! :wahoo:
 

someone19

Distinguished
Jan 16, 2011
441
3
18,810
The command line command 'groups' lists the groups your account is a member of. To mount a USB drive I think you need to be a member of usb, plugdev, and disk.

Then you just need to issue the proper mount command as I listed above.
 

panicmoment

Distinguished
Mar 6, 2011
6
0
18,510


so, if I'm a member of usb, plugdev and disk. I can issue the command to mount the USB even if I'm not a superuser or root?

Thank you for the reply! :)
 

someone19

Distinguished
Jan 16, 2011
441
3
18,810

That's the idea.
 

penguin_guy

Distinguished
Mar 10, 2011
78
0
18,640
The command is "lsusb". Shows all usb connected devices. And there is "lspci" for internal devices. Most of the user-friendly distros auto-mount usb's. What distro are you using?

1-)Plug your usb device.
2-)Run "lsusb". Look for your device.
2-)Run "dmesg | tail"
3-)It shows last kernel messages. You can see what happened to the device here.

And also run "fdisk -l" to list your hard drives. You can see usb flash drive or hdd there. (like /dev/sdb1, /dev/sdc1)
 

panicmoment

Distinguished
Mar 6, 2011
6
0
18,510
Thank you for all the replies! But our deadline on the project have already passed. I passed my project saving on a directory and not on a USB drive. Thank you again!