# mount usb external drives with write access

## ssottile

Hi,

I'm trying to mount an external USB disk in my gentoo installation. The problem I have is that I'm not able to mount it with write access.

My fstab configuration is :

/dev/sb1     /mnt/usbdisk    auto   noauto,user,exec,sync,gid=<user>,umask0002   0  0

when I  plug the disk in, i can see the following permissions (ls -al):

dr-xr-xr-x  root <user>  /mnt/usbdisk

I tried several combinations of the umask value in the fstab file, but I didn't manage to set the w permission.

Can you help?

Thanks

salvo

----------

## schachti

What filesystem do you use on that disk? What's the output of dmesg after connecting it to the PC and mounting it?

----------

## ssottile

Hi, apologies for the delay. I get this:

```

usb 2-2: new high speed USB device using ehci_hcd and address 4

usb 2-2: configuration #1 chosen from 1 choice

scsi2 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 4

usb-storage: waiting for device to settle before scanning

scsi 2:0:0:0: Direct-Access              FUJITSU MHV2080A 0000 PQ: 0 ANSI: 0 CCS

sd 2:0:0:0: [sdc] 156301488 512-byte hardware sectors (80026 MB)

sd 2:0:0:0: [sdc] Test WP failed, assume Write Enabled

sd 2:0:0:0: [sdc] Assuming drive cache: write through

sd 2:0:0:0: [sdc] 156301488 512-byte hardware sectors (80026 MB)

sd 2:0:0:0: [sdc] Test WP failed, assume Write Enabled

sd 2:0:0:0: [sdc] Assuming drive cache: write through

 sdc: sdc1

sd 2:0:0:0: [sdc] Attached SCSI disk

sd 2:0:0:0: Attached scsi generic sg1 type 0

usb-storage: device scan complete

BUG: unable to handle kernel paging request at virtual address 9d82746c

 printing eip:

c0135b40

*pde = 00000000

Oops: 0000 [#2]

SMP 

Modules linked in: nls_iso8859_1 ntfs fuse snd_pcm_oss snd_mixer_oss snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device tun nvidia(P) 3c59x mii pcmcia firmware_class snd_hda_intel snd_pcm snd_timer snd soundcore snd_page_alloc yenta_socket rsrc_nonstatic pcmcia_core sg rtc tg3 e1000 nfs lockd sunrpc jfs raid10 raid456 xor raid1 raid0 dm_bbr dm_snapshot dm_mirror dm_mod scsi_wait_scan pdc_adma sata_mv ata_piix ahci sata_qstor sata_vsc sata_uli sata_sis sata_sx4 sata_nv sata_via sata_svw sata_sil24 sata_sil sata_promise pata_sis libata sbp2 ohci1394 ieee1394 sl811_hcd usbhid ohci_hcd uhci_hcd usb_storage ehci_hcd usbcore

CPU:    1

EIP:    0060:[<c0135b40>]    Tainted: P       VLI

EFLAGS: 00210246   (2.6.22-gentoo-r9 #1)

eax: b6d74cf1   ebx: c225409c   ecx: 00000000   edx: ffffffff

esi: 00000000   edi: 00000000   ebp: 00000000   esp: f27bfe90

ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068

Process gnome-volume-ma (pid: 9727, ti=f27be000 task=c2153070 task.ti=f27be000)

Stack: 00000000 c03a0698 c225409c 000000d0 b6d74cf1 c2153070 c01367db b6d74cf1 

       00000044 b6d74cf1 00000000 000200d0 c03a0698 00000000 c0136a9e 00000044 

       00000012 00000000 f27bfef8 00000000 f948da60 000000d0 c03a0694 c2153070 

Call Trace:

 [<c01367db>] <0> [<c0136a9e>] <0> [<c0136a9e>] <0> [<f9488f77>] <0> [<f94894f0>] <0> [<f948ad54>] <0> [<c015608d>] <0> [<c010f2c3>] <0> [<c0156190>] <0> [<c015608d>] <0> [<c01563d0>] <0> [<c0102486>] <0> [<c0330000>] <0> =======================

Code: 02 00 00 00 89 d1 99 f7 f9 29 44 24 04 89 04 24 83 e7 10 74 12 8b 44 24 04 ba 04 00 00 00 89 d1 99 f7 f9 29 44 24 04 8b 44 24 1c <8b> 44 83 0c 03 44 24 04 39 c6 76 2b 89 da 31 db eb 1a 8b 82 8c 

EIP: [<c0135b40>]  SS:ESP 0068:f27bfe90

```

[/quote]

----------

## ssottile

Also,

I tried with a pen drive (USB) and it works fine, I have write access.

Thanks

salvo

----------

## NathanZachary

Do the USB flash drive and external harddrive use different filesystems?

----------

## bunder

Moved from Installing Gentoo to Kernel & Hardware.

----------

## ssottile

HI,

they should use the same fs. How can I check that?

Thx

salvo

----------

## twam

show us the output of "mount" after mounting the device

----------

## NathanZachary

I had this same problem because I thought that my external drive was using FAT32, but it was really formatted in NTFS.  Depending on the desktop environment that you are using, you should be able to right-click on the drive, click "properties" and it will tell you the filesystem type.

----------

## schachti

 *ssottile wrote:*   

> they should use the same fs. How can I check that?

 

```

file -s /dev/yourdevice

```

----------

## ssottile

HI,

the pen drive is VFAT and the external drive is NTFS. 

Thx

salvo

----------

## ssottile

Can I write on a NTFS fs type?

Thx

salvo

----------

## schachti

Not properly if you use the in-kernel driver. Use ntfs3g for writing on NTFS partitions, it's in portage. To know how to use it, have either a look on the projects website http://www.ntfs-3g.org/ or to this article in the gentoo wiki: http://gentoo-wiki.com/HOWTO_NTFS_write_with_ntfs-3g.

----------

## ssottile

Thanks a lot.

salvo

----------

