Fedora Linux Support Community & Resources Center
  #1  
Old 20th October 2011, 10:13 PM
simpleblue Offline
Registered User
 
Join Date: Nov 2010
Posts: 110
linuxfirefox
How do i copy a file to USB Stick?

I don't have the option to copy files from hardrive to USB Stick using nautilus. There is no paste or create directory. Ctr-V does not work.

So far the commands I've done are:

Code:
# umount /dev/sdb
# mkfs.ext4 /dev/sdb

Code:
# ls -ld /dev/sdb
brw-rw----. 1 root disk 8, 16 Oct 20 15:26 /dev/sdb
So do I need root permssion to copy the file? Can I reformat or change file permissions? I just want an easy solution. It can get a little tiring not even knowing where to start.

---------- Post added at 05:12 PM ---------- Previous post was at 03:40 PM ----------

Should Fedora automatically mount the drive?

I've looked up ways to mount the drive and there seems to be several, so I don't know where to start. Then there's formatting the USB drive. I also have an issue with the computer completely freezing up when I mount my USB drive manually a couple of times. This happened about 4 times so I don't wanna experiment.

I'm so frustrated I have a headache. What I thought was going to take 5 minutes so face has taken hours and no solution. Is there an easy way?

---------- Post added at 05:13 PM ---------- Previous post was at 05:12 PM ----------

If there is not easy solution in Fedora please tell me a distro that can do it.
Reply With Quote
  #2  
Old 20th October 2011, 10:37 PM
wardhj Offline
Registered User
 
Join Date: Jul 2009
Posts: 14
windows_98_nt_2000firefox
Re: How do i copy a file to USB Stick?

Your code snippets do not show that you ever mounted the device. Did you?
Reply With Quote
  #3  
Old 20th October 2011, 10:42 PM
sbinetd Offline
Registered User
 
Join Date: Oct 2011
Posts: 2
linuxfirefox
Re: How do i copy a file to USB Stick?

Firstly, you'll want to add a partition to your usb stick. You can either do this using a GUI tool like gparted (yum install gparted && gparted) or through the command line by typing:
Code:
fdisk /dev/sdb
p -- for new partition.
1 -- for first partition.
Enter/Return -- twice to span from the first block to the last block.
Enter/Return -- again to accept the default partition type.
w -- to write the changes to your pendrive.
From there, you can either format the partition using gparted, or through the same command you used:
Code:
mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /media/whereyouwantomount
Removing and re-inserting the stick should mount it automatically in /media/foldername, and it should appear in the left-hand list in nautilus. If you still can't add files to it in nautilus, give your non-root-user permissions to read and write through this:

Code:
chmod -R 766 /media/thefolder
or
chown -R yourusername:yourusername /media/thefolder
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #4  
Old 21st October 2011, 01:55 AM
simpleblue Offline
Registered User
 
Join Date: Nov 2010
Posts: 110
linuxfirefox
Re: How do i copy a file to USB Stick?

Quote:
Originally Posted by wardhj View Post
Your code snippets do not show that you ever mounted the device. Did you?
It might have been mounted and it might not have been. I'm not sure how to tell. I also here that it should be automatically mounted when it's plugged in, so I don't know if I'm already duplicating efforts here.


Quote:
Firstly, you'll want to add a partition to your usb stick. You can either do this using a GUI tool like gparted (yum install gparted && gparted) or through the command line by typing:
Code:

fdisk /dev/sdb
p -- for new partition.
1 -- for first partition.
Enter/Return -- twice to span from the first block to the last block.
Enter/Return -- again to accept the default partition type.
w -- to write the changes to your pendrive.

From there, you can either format the partition using gparted, or through the same command you used:
Code:

mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /media/whereyouwantomount

Removing and re-inserting the stick should mount it automatically in /media/foldername, and it should appear in the left-hand list in nautilus. If you still can't add files to it in nautilus, give your non-root-user permissions to read and write through this:

Code:

chmod -R 766 /media/thefolder
or
chown -R yourusername:yourusername /media/thefolder
Thank you so much for taking the time to type this up. I did what I could and here is what I have:


Code:
[root@localhost user]# umount /dev/sdb
[root@localhost user]# fdisk /dev/sdb1
fdisk: unable to open /dev/sdb1: No such file or directory
[root@localhost user]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x142d715d.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4, default 1): 1
First sector (2048-15625215, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15625215, default 15625215): 
Using default value 15625215

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost user]# mkfs.ext4 /dev/sdb
mke2fs 1.41.14 (22-Dec-2010)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
488640 inodes, 1953152 blocks
97657 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2000683008
60 block groups
32768 blocks per group, 32768 fragments per group
8144 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost user]# mount /dev/sdb /mnt/sdb
[root@localhost user]# chmod -R 766 /mnt/sdb
[root@localhost user]# cp sample.avi /mnt/sdb
cp: cannot create regular file `/mnt/sdb/sample.avi': Read-only file system
I don't see the USB Drive in nautilus.


* EDIT *

Code:
[root@localhost user]# umount /dev/sdb
[root@localhost user]# chmod 777 /mnt/sdb
[root@localhost user]# cp sample.avi /mnt/sdb
[root@localhost user]#
* EDIT 2 *

It works now. It just needed to be formatted to FAT32. I had initially formatted it to ext4 and heard somewhere else that this could cause problems. so this was the command i used:

Code:
mkdosfs -F 32 -I /dev/sdb
No mounting/unmounted/permissions/partitioning... required. I just pop it in and it automatically works. That's how I thought it should be.

* EDIT 3 *

Alright, after some discussion on IRC #Fedora I found out it likely was not partitioned correctly and corrected a few mistakes I made. So this works now:

Partition with Gparted. MSDOS with sdb1 partition as ext4.

Code:
[root@localhost user]# mkfs.ext4 -L myusbkey /dev/sdb1
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=myusbkey
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
488640 inodes, 1952768 blocks
97638 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2000683008
60 block groups
32768 blocks per group, 32768 fragments per group
8144 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost user]# mkdir /media/myusbkey
[root@localhost user]# mount /dev/sdb1 /media/myusbkey
[root@localhost user]# chown -R user:user /media/myusbkey
[root@localhost user]#

Last edited by simpleblue; 21st October 2011 at 04:15 AM.
Reply With Quote
  #5  
Old 25th October 2011, 06:54 PM
katykat Offline
Registered User
 
Join Date: May 2011
Posts: 44
windows_xp_2003firefox
Re: How do i copy a file to USB Stick?

Keep it simple.

Use a decent file manager like Gnome-Commander or mc (Midnight Commander) - and you can move/copy/edit files simply and easily.
Reply With Quote
Reply

Tags
copy, file, stick, usb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant copy zip file from cd BeerGut Using Fedora 2 16th October 2009 01:26 AM
Copy .raw file to CD biggsk Using Fedora 3 30th June 2009 08:03 PM
File Copy atkfrg56 Using Fedora 0 29th January 2009 03:47 PM
copy file over ftp Coruba67 Using Fedora 2 20th April 2007 10:54 AM
cant copy file from dvd ilbh Using Fedora 3 11th December 2006 08:43 PM


Current GMT-time: 21:51 (Thursday, 17-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat