Quote:
Originally Posted by wardhj
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]#