Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: USB write problems

  1. #1
    Join Date
    Mar 2006
    Location
    Waaaaaaaaay too far north
    Beans
    221
    Distro
    Ubuntu 14.04 Trusty Tahr

    USB write problems

    Hi, I'm having some noobish difficulty understanding something that is happening on my Kingston USB drive. If I try to execute this:
    $ sudo zcat boot.img.gz > /dev/sdb
    I get:
    $ /dev/sdb Permission Denied.
    But the drive is partitioned as FAT32 W95 (which I thought didn't have ownership issues).
    I thought it might be something to do with the type of partition so I tried to change the partition to a linux one, but get the same message.
    I also tried it with the disc mounted and unmounted.
    Here is the strange part. If I gained root (sudo su) I could execute the zcat boot.img.gz > /dev/sdb and also cp debian-40r5-i386-netinst.iso and it appears to write to the disc, but for some reason nothing is copied to the USB disk and it fails to boot the install program.
    I can however copy and create files directly onto the USB disc with no problem. So why does is deny me permissions sometimes? Whats going on!?
    Thanks.

    Some extra info...
    $ lsusb
    Bus 004 Device 003: ID 0951:1603 Kingston Technology
    Bus 004 Device 001: ID 0000:0000
    Bus 003 Device 001: ID 0000:0000
    Bus 002 Device 002: ID 046d:c001 Logitech, Inc. N48/M-BB48 [FirstMouse Plus]
    Bus 002 Device 001: ID 0000:0000
    Bus 001 Device 001: ID 0000:0000

    $ fdisk -l
    Disk /dev/sda: 40.0 GB, 40060403712 bytes
    255 heads, 63 sectors/track, 4870 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xd991d991

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 2425 19478781 7 HPFS/NTFS
    /dev/sda2 2426 4805 19117350 83 Linux
    /dev/sda3 4806 4870 522112+ 82 Linux swap / Solaris

    Disk /dev/sdb: 4141 MB, 4141875200 bytes
    255 heads, 63 sectors/track, 503 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000043e6

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 503 4040316 b W95 FAT32
    I'm using ubuntu 14.04

  2. #2
    Join Date
    Apr 2008
    Beans
    41
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: USB write problems

    i think that you should find where it is mounted . if you

    Code:
    ls /media
    you will see the directory disk. this must be your usb drive.

    so now try

    Code:
    sudo zcat boot.img.gz > /media/disk/
    BUT FIRST make sure tha /media/disk is your usb.

  3. #3
    Join Date
    Mar 2006
    Location
    Waaaaaaaaay too far north
    Beans
    221
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: USB write problems

    So here is what I get...



    $ ls /media
    ALIAS_SEASON_3_DISC_5 cdrom cdrom0 disk disk-1 floppy floppy0 hda1

    My USB stick is disk-1



    $ ls /media/disk-1
    new file new file~

    Yep, here are a test file i made.



    $ cd Desktop
    $ sudo zcat boot.img.gz > /media/disk-1
    bash: /media/disk-1: Is a directory

    Note, the USB stick is mounted.



    $ sudo zcat boot.img.gz > /media/disk-1
    bash: /media/disk-1: Permission denied

    Note, the USB stick is unmounted.



    $ ls /media/disk-1
    ls: cannot access /media/disk-1: No such file or directory

    ls with the USB stick unmounted.
    I'm using ubuntu 14.04

  4. #4
    Join Date
    Feb 2008
    Beans
    Hidden!

    Re: USB write problems

    r3bol: Did you ever resolve this?

    I have the same problem with a 1GB Lexar Jumpdrive. (Just trying to setup USB-based Debian installer -- have already done it successfully on numerous other USB flash drives)

    One interesting thing is that this drive under Windows shows up as a FIXED hard drive -- not removable. I don't know the impact this may have under Linux, if any.

    EDIT: Just noticed in dmesg:

    ... [sdb] Write Protect is off

    Hmm, not familiar with how to set/unset Write Protect (even though it says OFF)
    Last edited by tester321; December 24th, 2008 at 11:43 PM.

  5. #5
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,435
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: USB write problems

    I don't have time right now (leaving for a Christmas party), but the problem is probably in the permissions when the USB file system is mounted (won't matter if win95 or what). There is a small change to the 40-basic-permissions or some such file (I'm on my Windows box now or I'd just walk you through it) where the default for mounting the USB file system is root ownership. you can change that to 777 to gain access for all users.

    Scan the forum for recent (since 8.04 - that's when it changed) posts regarding USB permissions.

    I'm sorry I don't have the time right now. I'll check back later tonight and see if you need help yet.

    Gotta go!

    Dave

  6. #6
    Join Date
    Apr 2008
    Beans
    11,707

    Re: USB write problems

    You know, I read about these problems with external drives and I'm always puzzled

    By simply installing "pmount" from synaptic I have virtually no trouble whatsoever mounting external drives!

    If they're NTFS I also install "ntfsprogs".

    Both pmount and ntfsprogs are in synaptic.

    I'm lazy and I like to do things the gui way!

  7. #7
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,435
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: USB write problems

    Quote Originally Posted by kansasnoob View Post
    You know, I read about these problems with external drives and I'm always puzzled

    By simply installing "pmount" from synaptic I have virtually no trouble whatsoever mounting external drives!

    If they're NTFS I also install "ntfsprogs".

    Both pmount and ntfsprogs are in synaptic.

    I'm lazy and I like to do things the gui way!
    Yeah, I think in the case of the permissions file, it is taking things like USB sticks, etc., and mounting root. I'll find that and post back later. Some people run into this with other USB devices such as cameras. The problem started when the way /etc/udev/rules.d was reworked with the release of 8.10. It took a while to find it and to find the syntax had changed.

    Dave

  8. #8
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,435
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: USB write problems

    Okay, here's one of the places that causes access restricted to root (su or sudo) only:

    in /etc/udev/rules.d/40-basic-permissions.rules:

    Look for the line that says:
    # USB devices (usbfs replacement)

    It will be followed by 2 line as follows:

    SUBSYSTEM=="usb", ENV(DEVTYPE)=="usb_device", MODE="0664"
    SUBSYSTEM=="usb_device" MODE="0664"

    Note that the 2 modes are the permissions - the files/devices are only accessable to root. If you don't mind your USB devices being open to anyone using your computer, just change those 2 modes to MODE="0777". If you don't want them open to the world, you can assign users to a new group - say something like usbpeople, then change the 2 system to include group assignment to usbpeople and change the MODEs to the values you want.

    To edit this file in the gui:

    - open a terminal window

    - sudo gedit /etc/udev/rules.d/40-basic-permissions.rules


    I think if you just change these 2 MODE statements to 0777 you'll find you can access the devices without being root or su.
    I had this problem with some special cameras I have that don't look like a disk drive on the USB bus. When I moved to 8.04 I found they had changed the syntax to that noted above.

    Dave

  9. #9
    Join Date
    Oct 2008
    Beans
    4

    Re: USB write problems

    chmod 777 /dev/sdb1 when unmounted worked for me. problem was though that i can't boot from it :/

  10. #10
    Join Date
    Aug 2008
    Beans
    3

    Re: USB write problems

    I got the "permission denied" message and solved it by becoming the root user, rather than just sudoing the command.

    The easiest way to do this is with:

    sudo su -

    Then do the zcat command.

    BE CAREFUL, as root, you can do A LOT of damage VERY FAST. Be sure to exit as soon as you are done.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •