7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

How do you mount a USB Drive?

Fri Mar 22, 2013 9:46 pm

I have been trying to mount a usb drive for the past half an hour... I really don't know what I'm doing wrong!

My drive is formatted to FAT32, this is what I have been trying (sorry it's long!):

Code: Select all

pi@raspberrypi / $ sudo mount /dev/sda /mnt/usb
mount: you must specify the filesystem type
pi@raspberrypi / $ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           15G  1.5G   13G  11% /
/dev/root        15G  1.5G   13G  11% /
devtmpfs        212M     0  212M   0% /dev
tmpfs            44M  400K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   56M   19M   38M  34% /boot
pi@raspberrypi / $ sudo mount /dev/sda /mnt/usb
mount: you must specify the filesystem type
pi@raspberrypi / $ sudo mount -t vfat -o uid=pi,gid=pi /dev/sda /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

pi@raspberrypi / $ dmesg | tail
[ 2422.633776] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2469.060552] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2469.065678] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2469.075552] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2469.085564] FAT-fs (sda): invalid media value (0xb9)
[ 2469.085589] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2469.095687] FAT-fs (sda): invalid media value (0xb9)
[ 2469.095713] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2583.814281] FAT-fs (sda): invalid media value (0xb9)
[ 2583.814308] FAT-fs (sda): Can't find a valid FAT filesystem
pi@raspberrypi / $ sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/USBDRIVE/
mount: mount point /media/USBDRIVE/ does not exist
pi@raspberrypi / $ sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/USBDRIVE/
mount: mount point /media/USBDRIVE/ does not exist
pi@raspberrypi / $ sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/USBDRIVE/
mount: mount point /media/USBDRIVE/ does not exist
pi@raspberrypi / $ sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /mnt/usb
mount: unknown filesystem type 'ntfs-3g'
pi@raspberrypi / $ sudo mount -t ntfs -o uid=pi,gid=pi /dev/sda1 /mnt/usb
mount: special device /dev/sda1 does not exist
pi@raspberrypi / $ sudo mount -t ntfs -o uid=pi,gid=pi /dev/sda /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

pi@raspberrypi / $ dmesg
[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.6.11+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: BCM2708
[    0.000000] cma: CMA: reserved 16 MiB at 1b000000
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 114688
[    0.000000] free_area_init_node: node 0, pgdat c053b834, node_mem_map c05e5000
[    0.000000]   Normal zone: 896 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 113792 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 113792
[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0xe bcm2708.serial=0x517f584e smsc95xx.macaddr=B8:27:EB:7F:58:4E sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 448MB = 448MB total
[    0.000000] Memory: 432264k/432264k available, 26488k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xdc800000 - 0xff000000   ( 552 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdc000000   ( 448 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc04e5470   (4982 kB)
[    0.000000]       .init : 0xc04e6000 - 0xc0506f24   ( 132 kB)
[    0.000000]       .data : 0xc0508000 - 0xc053c060   ( 209 kB)
[    0.000000]        .bss : 0xc053c084 - 0xc05e4738   ( 674 kB)
[    0.000000] NR_IRQS:330
[    0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4294967ms
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [tty1] enabled
[    0.001010] Calibrating delay loop... 464.48 BogoMIPS (lpj=2322432)
[    0.060062] pid_max: default: 32768 minimum: 301
[    0.060418] Mount-cache hash table entries: 512
[    0.061187] Initializing cgroup subsys cpuacct
[    0.061241] Initializing cgroup subsys devices
[    0.061275] Initializing cgroup subsys freezer
[    0.061304] Initializing cgroup subsys blkio
[    0.061398] CPU: Testing write buffer coherency: ok
[    0.061734] hw perfevents: enabled with v6 PMU driver, 3 counters available
[    0.061875] Setting up static identity map for 0x39d3f8 - 0x39d454
[    0.063374] devtmpfs: initialized
[    0.074125] NET: Registered protocol family 16
[    0.080612] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[    0.081711] bcm2708.uart_clock = 0
[    0.083077] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.083130] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.083167] mailbox: Broadcom VideoCore Mailbox driver
[    0.083259] bcm2708_vcio: mailbox at f200b880
[    0.083361] bcm_power: Broadcom power driver
[    0.083399] bcm_power_open() -> 0
[    0.083423] bcm_power_request(0, 8)
[    0.584114] bcm_mailbox_read -> 00000080, 0
[    0.584155] bcm_power_request -> 0
[    0.584181] Serial: AMBA PL011 UART driver
[    0.584325] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83) is a PL011 rev3
[    0.908053] console [ttyAMA0] enabled
[    0.931542] bio: create slab <bio-0> at 0
[    0.936416] SCSI subsystem initialized
[    0.940511] usbcore: registered new interface driver usbfs
[    0.946092] usbcore: registered new interface driver hub
[    0.951687] usbcore: registered new device driver usb
[    0.958027] Switching to clocksource stc
[    0.962273] FS-Cache: Loaded
[    0.965413] CacheFiles: Loaded
[    0.980210] NET: Registered protocol family 2
[    0.985496] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.993235] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[    1.000026] TCP: Hash tables configured (established 16384 bind 16384)
[    1.006631] TCP: reno registered
[    1.009883] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.015779] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.022355] NET: Registered protocol family 1
[    1.027217] RPC: Registered named UNIX socket transport module.
[    1.033262] RPC: Registered udp transport module.
[    1.037985] RPC: Registered tcp transport module.
[    1.042731] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.049842] bcm2708_dma: DMA manager at f2007000
[    1.054622] bcm2708_gpio: bcm2708_gpio_probe c0515d98
[    1.060087] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[    1.069239] audit: initializing netlink socket (disabled)
[    1.074835] type=2000 audit(0.930:1): initialized
[    1.198041] VFS: Disk quotas dquot_6.5.2
[    1.202076] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.209141] FS-Cache: Netfs 'nfs' registered for caching
[    1.214890] NFS: Registering the id_resolver key type
[    1.220051] Key type id_resolver registered
[    1.224345] Key type id_legacy registered
[    1.228705] msgmni has been set to 876
[    1.234220] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.241936] io scheduler noop registered
[    1.245982] io scheduler deadline registered (default)
[    1.251164] io scheduler cfq registered
[    1.276357] Console: switching to colour frame buffer device 82x26
[    1.287784] kgdb: Registered I/O driver kgdboc.
[    1.294964] vc-cma: Videocore CMA driver
[    1.300767] vc-cma: vc_cma_base      = 0x00000000
[    1.307357] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    1.314554] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    1.330482] brd: module loaded
[    1.340173] loop: module loaded
[    1.345393] vchiq: vchiq_init_state: slot_zero = 0xdb000000, is_master = 0
[    1.354757] Loading iSCSI transport class v2.0-870.
[    1.362425] usbcore: registered new interface driver smsc95xx
[    1.369985] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.582555] Core Release: 2.80a
[    1.587395] Setting default values for core params
[    1.593969] Finished setting default values for core params
[    1.806340] Using Buffer DMA mode
[    1.811342] Periodic Transfer Interrupt Enhancement - disabled
[    1.818856] Multiprocessor Interrupt Enhancement - disabled
[    1.826136] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.832199] Dedicated Tx FIFOs mode
[    1.838334] dwc_otg: Microframe scheduler enabled
[    1.838735] dwc_otg bcm2708_usb: DWC OTG Controller
[    1.845457] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[    1.854597] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000
[    1.861844] Init: Port Power? op_state=1
[    1.867477] Init: Power Port (0)
[    1.872516] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.881135] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.890219] usb usb1: Product: DWC OTG Controller
[    1.896788] usb usb1: Manufacturer: Linux 3.6.11+ dwc_otg_hcd
[    1.904392] usb usb1: SerialNumber: bcm2708_usb
[    1.911453] hub 1-0:1.0: USB hub found
[    1.917076] hub 1-0:1.0: 1 port detected
[    1.923073] dwc_otg: FIQ enabled
[    1.923091] dwc_otg: NAK holdoff enabled
[    1.923111] Module dwc_common_port init
[    1.923328] Initializing USB Mass Storage driver...
[    1.930134] usbcore: registered new interface driver usb-storage
[    1.937983] USB Mass Storage support registered.
[    1.944520] usbcore: registered new interface driver libusual
[    1.952355] mousedev: PS/2 mouse device common for all mice
[    1.960390] bcm2835-cpufreq: min=700000 max=700000 cur=700000
[    1.966257] bcm2835-cpufreq: switching to governor powersavebcm2835-cpufreq: switching to governor powersave
[    1.979676] cpuidle: using governor ladder
[    1.987431] cpuidle: using governor menu
[    1.993170] sdhci: Secure Digital Host Controller Interface driver
[    2.001121] sdhci: Copyright(c) Pierre Ossman
[    2.007331] sdhci: Enable low-latency mode
[    2.052358] mmc0: SDHCI controller on BCM2708_Arasan [platform] using platform's DMA
[    2.063929] mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77
[    2.073857] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.087176] usbcore: registered new interface driver usbhid
[    2.094779] usbhid: USB HID core driver
[    2.105276] TCP: cubic registered
[    2.112635] Initializing XFRM netlink socket
[    2.120972] NET: Registered protocol family 17
[    2.127511] Indeed it is in host mode hprt0 = 00021501
[    2.138039] Key type dns_resolver registered
[    2.152511] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    2.174660] mmc0: could read SD Status register (SSR) at the 2th attempt
[    2.184102] registered taskstats version 1
[    2.202701] Waiting for root device /dev/mmcblk0p2...
[    2.213660] mmc0: new high speed SDHC card at address b368
[    2.232371] mmcblk0: mmc0:b368 SDC   15.0 GiB 
[    2.253601]  mmcblk0: p1 p2
[    2.382206] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.390903] Indeed it is in host mode hprt0 = 00001101
[    2.428858] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.452225] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.481440] devtmpfs: mounted
[    2.492560] Freeing init memory: 128K
[    2.632502] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.641392] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.651382] hub 1-1:1.0: USB hub found
[    2.658245] hub 1-1:1.0: 3 ports detected
[    2.942380] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.062876] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.071890] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.097067] smsc95xx v1.0.4
[    3.177216] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:7f:58:4e
[    3.302409] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    3.424485] usb 1-1.2: New USB device found, idVendor=7392, idProduct=7811
[    3.437302] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.446963] usb 1-1.2: Product: 802.11n WLAN Adapter
[    3.454151] usb 1-1.2: Manufacturer: Realtek
[    3.460442] usb 1-1.2: SerialNumber: 00e04c000001
[    3.994249] udevd[142]: starting version 175
[    5.173798] Registered led device: led0
[    6.497588] usbcore: registered new interface driver rtl8192cu
[    9.751260] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   10.200608] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   10.949552] bcm2835 ALSA card created!
[   10.960987] bcm2835 ALSA chip created!
[   10.975049] bcm2835 ALSA chip created!
[   10.986560] bcm2835 ALSA chip created!
[   10.995024] bcm2835 ALSA chip created!
[   11.003768] bcm2835 ALSA chip created!
[   11.013213] bcm2835 ALSA chip created!
[   11.021737] bcm2835 ALSA chip created!
[   24.161142] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
[ 1730.560325] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[ 1731.132742] usb 1-1.3: New USB device found, idVendor=058f, idProduct=6387
[ 1731.132773] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1731.132790] usb 1-1.3: Product: Mass Storage
[ 1731.132804] usb 1-1.3: Manufacturer: Generic
[ 1731.132817] usb 1-1.3: SerialNumber: 967AB9B4
[ 1731.150278] scsi0 : usb-storage 1-1.3:1.0
[ 1732.153568] scsi 0:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 4
[ 1732.156096] sd 0:0:0:0: [sda] 125304832 512-byte logical blocks: (64.1 GB/59.7 GiB)
[ 1732.157244] sd 0:0:0:0: [sda] Write Protect is off
[ 1732.157281] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[ 1732.158491] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 1732.950150]  sda: sda2
[ 1732.955450] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 1978.171336] usb 1-1.3: USB disconnect, device number 5
[ 2096.436899] usb 1-1.3: new high-speed USB device number 6 using dwc_otg
[ 2097.009325] usb 1-1.3: New USB device found, idVendor=058f, idProduct=6387
[ 2097.009357] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2097.009373] usb 1-1.3: Product: Mass Storage
[ 2097.009387] usb 1-1.3: Manufacturer: Generic
[ 2097.009400] usb 1-1.3: SerialNumber: 967AB9B4
[ 2097.026829] scsi1 : usb-storage 1-1.3:1.0
[ 2098.030141] scsi 1:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 4
[ 2098.032677] sd 1:0:0:0: [sda] 125304832 512-byte logical blocks: (64.1 GB/59.7 GiB)
[ 2098.033857] sd 1:0:0:0: [sda] Write Protect is off
[ 2098.033894] sd 1:0:0:0: [sda] Mode Sense: 23 00 00 00
[ 2098.035088] sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 2098.824853]  sda: sda2
[ 2098.830039] sd 1:0:0:0: [sda] Attached SCSI removable disk
[ 2422.596112] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2422.603491] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2422.613515] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2422.623500] FAT-fs (sda): invalid media value (0xb9)
[ 2422.623526] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2422.633751] FAT-fs (sda): invalid media value (0xb9)
[ 2422.633776] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2469.060552] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2469.065678] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2469.075552] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 2469.085564] FAT-fs (sda): invalid media value (0xb9)
[ 2469.085589] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2469.095687] FAT-fs (sda): invalid media value (0xb9)
[ 2469.095713] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2583.814281] FAT-fs (sda): invalid media value (0xb9)
[ 2583.814308] FAT-fs (sda): Can't find a valid FAT filesystem
[ 2648.288598] NTFS driver 2.1.30 [Flags: R/W MODULE].
[ 2654.856943] NTFS-fs warning (device sda): is_boot_sector_ntfs(): Invalid boot sector checksum.
[ 2654.856978] NTFS-fs error (device sda): read_ntfs_boot_sector(): Primary boot sector is invalid.
[ 2654.856996] NTFS-fs error (device sda): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
[ 2654.857010] NTFS-fs error (device sda): ntfs_fill_super(): Not an NTFS volume.
[ 2719.392040] usb 1-1.3: USB disconnect, device number 6
pi@raspberrypi / $ sudo mount -t msdos -o uid=pi,gid=pi /dev/sda /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

pi@raspberrypi / $ sudo mount -t vfat -o uid=pi,gid=pi /dev/sda /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

pi@raspberrypi / $ mount -t vfat -o umask=000 /dev/sda /mnt/usb
mount: only root can do that
pi@raspberrypi / $ sudo mount -t vfat -o umask=000 /dev/sda /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

pi@raspberrypi / $ sudo mount -t msdos -o umask=000 /dev/sda /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

pi@raspberrypi / $ dmesg | tail
[ 2982.918596]  sda: sda2
[ 2982.923026] sd 2:0:0:0: [sda] Attached SCSI removable disk
[ 3144.126778] FAT-fs (sda): invalid media value (0xb9)
[ 3144.126804] FAT-fs (sda): Can't find a valid FAT filesystem
[ 3157.446962] FAT-fs (sda): invalid media value (0xb9)
[ 3157.446988] FAT-fs (sda): Can't find a valid FAT filesystem
[ 3315.877355] FAT-fs (sda): invalid media value (0xb9)
[ 3315.877381] FAT-fs (sda): Can't find a valid FAT filesystem
[ 3327.096008] FAT-fs (sda): invalid media value (0xb9)
[ 3327.096033] FAT-fs (sda): Can't find a valid FAT filesystem
pi@raspberrypi / $ sudo mount -t fat-fs -o umask=000 /dev/sda /mnt/usb
mount: unknown filesystem type 'fat-fs'
mount: maybe you meant 'vfat'?
pi@raspberrypi / $ sudo mount -t vfat -o umask=000 /dev/sda /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

pi@raspberrypi / $ 
Raspberry Pi - Model B (512MB)

stubright
Posts: 122
Joined: Sat Dec 24, 2011 11:12 pm

Re: How do you mount a USB Drive?

Fri Mar 22, 2013 9:59 pm

Hi 7ewis
You've missed the partition number from your mount command.

sudo mount -t vfat /dev/sda1 /mnt/usb

Also make sure the usb folder in mnt exists. If not then

mkdir -p /mnt/usb

Stu

User avatar
joan
Posts: 15038
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How do you mount a USB Drive?

Fri Mar 22, 2013 10:04 pm

Insert your dongle and do

ls /dev/sd*

You should see the sd card plus any partitions on the sd card.

e.g. /dev/sda, /dev/sda1

You need to mount the partition which will be of the form /dev/sda1, /dev/sda2 etc.

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: How do you mount a USB Drive?

Fri Mar 22, 2013 10:13 pm

Thanks Stu, didn't know I had to choose a the number, in the guide I was following it said it would just be 'sda' if that's what it said in dmesg, which it did.

Thank joan, found out from that that it was actually sda2!

So I put that with Stu's code and it mounted!


Now, is it possible to make it automatically do that every time I plug it in?
Raspberry Pi - Model B (512MB)

stubright
Posts: 122
Joined: Sat Dec 24, 2011 11:12 pm

Re: How do you mount a USB Drive?

Fri Mar 22, 2013 10:55 pm

If you

sudo nano /etc/fstab

then add the line to the end

/dev/sda2 /mnt/usb vfat defaults 0 2

it should mount at boot, assuming the sda2 does not change, which it can if other drives exist at boot up.

A better option is to use uuid instead of /dev/
the uuid can be found using the following

ls -l /dev/disk/by-uuid/

or gparted has the same info

then your fstab line would start
UUID=long_hex_number_from_previous_command /mnt/usb vfat defaults 0 2

Using that method means it doesn't matter whether your drive comes up as sda1 or sdb2 or whatever if another drive is in when the Pi is booted.

I've always used uuid on all of my computers.

Stu

TheQuestor
Posts: 80
Joined: Wed Nov 28, 2012 9:15 am

Re: How do you mount a USB Drive?

Fri Mar 22, 2013 10:57 pm

7ewis wrote:Thanks Stu, didn't know I had to choose a the number, in the guide I was following it said it would just be 'sda' if that's what it said in dmesg, which it did.

Thank joan, found out from that that it was actually sda2!

So I put that with Stu's code and it mounted!


Now, is it possible to make it automatically do that every time I plug it in?
1st off I formatted my USB key ext4 so my FS might be different


mkdir /media/usb
sudo nano /etc/fstab
add this line
/dev/sda1 /media/usb ext4 rw 0 3
save and exit, then on your next reboot it should automount you can test before you reboot by typing
mount /media/usb
if it mounts then you're good to go.
also MY usb key is /dev/sda1 yours might be different
yours might look like
/dev/sda1 /media vfat rw 0 3

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: How do you mount a USB Drive?

Fri Mar 22, 2013 11:28 pm

stubright wrote:If you

sudo nano /etc/fstab

then add the line to the end

/dev/sda2 /mnt/usb vfat defaults 0 2

it should mount at boot, assuming the sda2 does not change, which it can if other drives exist at boot up.

A better option is to use uuid instead of /dev/
the uuid can be found using the following

ls -l /dev/disk/by-uuid/

or gparted has the same info

then your fstab line would start
UUID=long_hex_number_from_previous_command /mnt/usb vfat defaults 0 2

Using that method means it doesn't matter whether your drive comes up as sda1 or sdb2 or whatever if another drive is in when the Pi is booted.

I've always used uuid on all of my computers.

Stu
Just as you said this, I realised it changed to sdb2!

So:

pi@raspberrypi /etc $ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Mar 22 23:20 1C2E-BAB5 -> ../../sdb2
lrwxrwxrwx 1 root root 15 Mar 22 22:46 62ba9ec9-47d9-4421-aaee-71dd6c0f3707 -> ../../mmcblk0p2
lrwxrwxrwx 1 root root 15 Jan 1 1970 C522-EA52 -> ../../mmcblk0p1
pi@raspberrypi /etc $


The UUID is '1C2E-BAB5' now? (Edit: It's working now; thanks!)

One more thing.. How can I change the permissions so that I can allow transmission-daemon download torrents directly to the usb? I don't want to keep writing to my SD card, I don't want it to wear out quickly and would prefer my downloads on a flash drive anyway.
Raspberry Pi - Model B (512MB)

stubright
Posts: 122
Joined: Sat Dec 24, 2011 11:12 pm

Re: How do you mount a USB Drive?

Fri Mar 22, 2013 11:55 pm

Unfortunately I haven't used transmission on the Pi, however, to change ownership of a folder you

sudo chown -R your_user_name /mnt/usb

That, in theory, would give your user name the same access to the mount as root, instead of root only access.

I hope that works.

Stu

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 12:01 am

I tried it using the username 'pi' and it didn't work.

But, I think transmission gets its own username or something? So would I have to put that in there?

If you ever download torrents, it's quite useful to leave your Pi on overnight instead of your PC, so you should check it out!
Raspberry Pi - Model B (512MB)

stubright
Posts: 122
Joined: Sat Dec 24, 2011 11:12 pm

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 12:59 am

I do use transmission but only on my PC when I'm using it. Transmission is a thousand time better than any Windows based torrent crap I've use in the past.
I've just tried transmission-daemon on my Pi and it worked using an external (fstab mounted) usb drive and a web interface.

First
sudo service transmission-daemon stop

Then I edited
sudo nano /etc/transmission-daemon/settings.json
and changed
"download-dir": "/path/to/folder",
I also changed
"incomplete-dir": "/path/to/another/folder",
and
"rpc-username": "your_user_name"
and
"rpc-password": "any_password_you_want",
and
"rpc-whitelist": "ip_address_for_the_computer_you_access_it_from",
I am assuming you could add multiple white list entries
then
sudo service transmission-daemon start

login from a web browser using
/Pi_IP_Address:9091/

The folders I made for downloads and incomplete downloads were made using the Pi user and not root.

I hope that works, I'll apologise for any errors as I've only used the daemon for half an hour.
Stu

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 12:24 pm

Yeah that's what I had been trying, it starts to download a file, and only when the download folder is on the usb drive, towards the end of the download it will give me an error saying 'Permission Denied'.

Not sure why it happens to me and not you though, if you haven't changed anything else?
Raspberry Pi - Model B (512MB)

stubright
Posts: 122
Joined: Sat Dec 24, 2011 11:12 pm

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 12:44 pm

Do you have any spaces or unusual characters in the folder names. I can get pemission denied if there are spaces.
The path for my downloads is
/home/stu/storage/Data
but if I use
/home/stu/storage/Torrent Data
it falls over.

Stu

klricks
Posts: 7231
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 1:31 pm

stubright wrote:Do you have any spaces or unusual characters in the folder names. I can get pemission denied if there are spaces.
The path for my downloads is
/home/stu/storage/Data
but if I use
/home/stu/storage/Torrent Data
it falls over.

Stu
You might try " " around files or directories with spaces.
cd one two
does not work

cd "one two"
works
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

stubright
Posts: 122
Joined: Sat Dec 24, 2011 11:12 pm

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 1:41 pm

You might try " " around files or directories with spaces.
cd one two
does not work

cd "one two"
works
Yes, that works on the command line but the config file for the torrent daemon already uses " " around the path. I haven't tried any other options because not using spaces in the folder names works.
Stu

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 1:48 pm

My download folder is just

mnt/usb/Downloads

Nothing special about it, apart from the capital in Downloads which don't think would make a difference?

Edit: Okay, forgetting transmission for a minute, I went into my usb and tried wget'ing a file, and it gave me permission denied as well, then I tried it with sudo and it worked. Surely there must be some basic permission changes that I need to do some how? I have tried all the chown comands I have found, and tried chmod 777 etc. Does it matter that it's formatted to fat32? I don't want to reformat though because I use it for other things that can only read fat32.
Raspberry Pi - Model B (512MB)

stubright
Posts: 122
Joined: Sat Dec 24, 2011 11:12 pm

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 2:09 pm

fat32 doesn't support permissions, so that is probably the problem.

In your fstab file, edit the line for your usb drive, where it says

defaults

and change it to

defaults,umask=000

that should make you the owner of the usb drive.

Stu

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: How do you mount a USB Drive?

Sat Mar 23, 2013 3:44 pm

It works now!

Thank you so much! Now I just need to setup OpenVPN and I'm good to go!

I have Samba and miniDLNA so I can stream everything from my Pi around my house!
Raspberry Pi - Model B (512MB)

User avatar
MartyMacGyver
Posts: 32
Joined: Sat Jan 26, 2013 1:37 am

Re: How do you mount a USB Drive?

Tue Mar 26, 2013 1:38 am

7ewis wrote:I have been trying to mount a usb drive for the past half an hour... I really don't know what I'm doing wrong!
For general usage, I got stuck on the permissions thing myself. It's pretty easy to mount a typical USB drive (e.g., FAT formatted - I haven't tested NTFS yet). Note that I'm using the "Occidentalis v0.2" version of the OS, though I expect it's pretty much the same on the standard one as well.

I've got a USB drive I wanted to work with as user "pi". I booted up and later plugged the drive in. Running "sudo fdisk -l" showed that it's being detected automagically as /dev/sda1.

At that point you create an empty mount directory (if it's not already there), e.g.:
sudo mkdir /mnt/USB

Then you mount the partition. The key is to specify the owner in your mount command, thus:
sudo mount -o uid=pi,gid=pi /dev/sda1 /mnt/USB

This saves having to fiddle with fstab and such (obviously not everything can be automounted, but in this case it was quite simple).

You can find more info on the wiki at http://elinux.org/RPi_Adding_USB_Drives.

abhishek2386
Posts: 4
Joined: Mon Jul 15, 2013 8:25 am

Re: How do you mount a USB Drive?

Mon Jul 15, 2013 8:27 am

Check out these simple steps to mount your USB drive here:
http://www.techjawab.com/2013/06/how-to ... -hard.html

NateJO
Posts: 1
Joined: Sun Jun 07, 2015 4:32 am

Re: How do you mount a USB Drive?

Sun Jun 07, 2015 4:53 am

stubright wrote:If you

sudo nano /etc/fstab

then add the line to the end

/dev/sda2 /mnt/usb vfat defaults 0 2

it should mount at boot, assuming the sda2 does not change, which it can if other drives exist at boot up.

A better option is to use uuid instead of /dev/
the uuid can be found using the following

ls -l /dev/disk/by-uuid/

or gparted has the same info

then your fstab line would start
UUID=long_hex_number_from_previous_command /mnt/usb vfat defaults 0 2

Using that method means it doesn't matter whether your drive comes up as sda1 or sdb2 or whatever if another drive is in when the Pi is booted.

I've always used uuid on all of my computers.

Stu
I went to find the UUID of the SD card I want to mount on start-up. You mentioned it should be a long hex number. However, when I execute the command, some of the drives have a long hex number, others are very short.

For example, my external drive shows up as "lrwxrwxrwx 1 root root 10 Jun 6 22:17 6135-3039 -> ../../sda1"

Other entries have long hex numbers such as "a0a67eb4-9835-424d-8b85-d97e960954e6" or "3a1c7ff4-3700-4fb1-9234-9de0cc1c9b45" in the same position of the entry.

Is the 6135-3039 the UUID?

User avatar
DougieLawson
Posts: 39793
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How do you mount a USB Drive?

Sun Jun 07, 2015 8:22 am

NateJO wrote: Is the 6135-3039 the UUID?
Yes for a FAT filesystem.

The simplest way to find UUID is with the blkid command.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Return to “General discussion”