LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HOW TO COPY FROM usb to harddisk (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-copy-from-usb-to-harddisk-726509/)

RATHINDRA NATH KARMAKAR 05-17-2009 12:00 AM

HOW TO COPY FROM usb to harddisk
 
I USE RED HAT 8.0 (PSYCHE) I COPIED FROM MY harddisk to (SANDISK MICRO CRUZER)
BY 1> mkdir /mnt/usb 2> mount /dev/sda1 /mnt/usb 3> cp x.txt /mnt/usb
but then i tried
cd /mnt/usb 2> cp x.txt /root but failed so kindly tell me how to copy from usb to harddisk .

raskin 05-17-2009 01:20 AM

What does "cat /mnt/usb/x.txt" do? Please post exact error messages from both cp and cat.

jschiwal 05-17-2009 02:18 AM

It would be more understandable if you put each command on a separate line. The first time I read it, I thought your ran "mkdir /mnt/usb 2".
Repeating the process and cutting and pasting the commands would provide us with the exact commands & error messages.

You should indicate what filesystem is on the usb stick. If it is fat32, which is the most common, use the filesystem vfat when mounting. You need to add options in the mount commands to change the ownership & permissions during the mount. E.G. If your username is "rkarmakar", you might use "sudo mount -t /dev/sda1 /mnt/usb -o rw,default,uid=rkarmakar,fmask=0110,dmask=0001".

I can't imagine that a usb stick would have the device node sda1, unless you are running an older kernel that uses the device node /dev/hda for the first pata disk.

Also remember that /root is for the root user. You can't copy files there as a normal user, and shouldn't be messing around with system directories without good reason.

raskin 05-17-2009 02:35 AM

He is probably running an older (as in year 2003) kernel. RH 8.0 Psyche was released in 2002. It does look like he is running as root, as "mkdir /mnt/usb" is not something an unprivileged user could do. If the kernel is a bit newer, FS question may be especially interesting, as Linux kernel has been able to mount NTFS read-only for a significant amount of time, but the only widespread and mature NTFS-write implementation is userspace NTFS-3g (which usually needs to be mounted in its own way, without mount).

RATHINDRA NATH KARMAKAR 05-25-2009 09:39 AM

thank you raskin, your cat command did not work but i borrowed the
syntax

at root i wrote

cp /mnt/usb/x.txt .

and the file was astonishingly copied from my usb to hard disk


All times are GMT -5. The time now is 06:43 AM.