cschwing
Posts: 4
Joined: Wed Jul 15, 2015 9:21 pm

[SOLVED] Trying to mount a hard drive to the pi

Wed Jul 15, 2015 9:28 pm

I purchased a WD Mypassport ultra 2TB drive. It's plugged into a verified powered USB hub (the Plugable 7 port hub). My end goal here is to format the entire drive to ext4 and mount it to the pi to use it as an Owncloud server. When i first started his, the drive showed up in blkid. I tried formatting it to ext4, but it didn't quite work.

This is my partition table in fdisk

Code: Select all

Disk /dev/sda (Sun disk label): 255 heads, 63 sectors, 46589 cylinders
Units = sectors of 1 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/sda1             0 748452285 374226142+  83  Linux native
The drive is recognized in lsusb

Code: Select all

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 006: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 007: ID 1058:0820 Western Digital Technologies, Inc.
But not in blkid

Code: Select all

/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="15CD-3B79" TYPE="vfat"
/dev/mmcblk0p2: UUID="13d368bf-6dbf-4751-8ba1-88bed06bef77" TYPE="ext4"
When i try to create the filesystem with sudo mkfs.ext4 /dev/sdaX

Code: Select all

Could not stat /dev/sda1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?
I'm lost
Last edited by cschwing on Thu Jul 16, 2015 2:54 pm, edited 1 time in total.

FigNewton
Posts: 28
Joined: Mon Jun 29, 2015 4:41 pm

Re: Trying to mount a hard drive to the pi

Thu Jul 16, 2015 4:12 am

This is a longshot, but is there a chance it disconnected between the time you fdisk'ed it and tried to make the filesystem? I was having some issues with my 1tb drive connecting and disconnecting the other night. I ended up moving the usb hub to another of the ports on the pi, and it went stable. Are there any entries in 'dmesg' that might show it lost connection?

User avatar
DougieLawson
Posts: 36560
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Trying to mount a hard drive to the pi

Thu Jul 16, 2015 12:07 pm

Have you added

Code: Select all

max_usb_current=1
to your config.txt? If the drive doesn't have enough power it may be getting the controller active but not spinning up the drive.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
PeterO
Posts: 5140
Joined: Sun Jul 22, 2012 4:14 pm

Re: Trying to mount a hard drive to the pi

Thu Jul 16, 2015 1:13 pm

DougieLawson wrote:Have you added

Code: Select all

max_usb_current=1
to your config.txt? If the drive doesn't have enough power it may be getting the controller active but not spinning up the drive.
From the OP " It's plugged into a verified powered USB hub (the Plugable 7 port hub)" so not going to help !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

cschwing
Posts: 4
Joined: Wed Jul 15, 2015 9:21 pm

Re: Trying to mount a hard drive to the pi

Thu Jul 16, 2015 2:18 pm

FigNewton wrote:This is a longshot, but is there a chance it disconnected between the time you fdisk'ed it and tried to make the filesystem? I was having some issues with my 1tb drive connecting and disconnecting the other night. I ended up moving the usb hub to another of the ports on the pi, and it went stable. Are there any entries in 'dmesg' that might show it lost connection?
This is the output of dmesg (only the part that has to do with the disk)

Code: Select all

[    5.134264] sd 0:0:0:0: [sda] Spinning up disk...
[    6.098541] udevd[180]: starting version 175
[    6.147837] .ready
[    6.152999] sd 0:0:0:0: [sda] 3906963456 512-byte logical blocks: (2.00 TB/1.81 TiB)
[    6.165785] sd 0:0:0:0: [sda] Write Protect is off
[    6.173024] sd 0:0:0:0: [sda] Mode Sense: 47 00 10 08
[    6.173744] sd 0:0:0:0: [sda] No Caching mode page found
[    6.181498] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    6.196722]  sda: sda1
[    6.208948] sd 0:0:0:0: [sda] Attached SCSI disk
[    6.243660] random: nonblocking pool is initialized
[    7.186992] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    7.196500] scsi 0:0:0:1: Attached scsi generic sg1 type 13
[    8.780242] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    9.171723] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   13.391645] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   14.979887] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[   16.286436] cfg80211: Calling CRDA to update world regulatory domain
[   16.878252] Adding 102396k swap on /var/swap.  Priority:-1 extents:2 across:2134012k SSFS
[   19.723355] ip_tables: (C) 2000-2006 Netfilter Core Team
[  741.738106] usb 1-1.5: USB disconnect, device number 4
[  741.738135] usb 1-1.5.5: USB disconnect, device number 5
[  744.529100] usb 1-1.5: new high-speed USB device number 6 using dwc_otg
[  744.629738] usb 1-1.5: New USB device found, idVendor=1a40, idProduct=0201
[  744.629763] usb 1-1.5: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[  744.629780] usb 1-1.5: Product: USB 2.0 Hub [MTT]
[  744.630782] hub 1-1.5:1.0: USB hub found
[  744.630998] hub 1-1.5:1.0: 7 ports detected
[  744.909113] usb 1-1.5.5: new high-speed USB device number 7 using dwc_otg
[  745.010448] usb 1-1.5.5: New USB device found, idVendor=1058, idProduct=0820
[  745.010473] usb 1-1.5.5: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[  745.010491] usb 1-1.5.5: Product: My Passport 0820
[  745.010508] usb 1-1.5.5: Manufacturer: Western Digital
[  745.010524] usb 1-1.5.5: SerialNumber: 57584131413335504A55584C
[  745.011676] usb-storage 1-1.5.5:1.0: USB Mass Storage device detected
[  745.012182] scsi host1: usb-storage 1-1.5.5:1.0
[  746.009830] scsi 1:0:0:0: Direct-Access     WD       My Passport 0820 1012 PQ: 0 ANSI: 6
[  746.011731] sd 1:0:0:0: [sda] 3906963456 512-byte logical blocks: (2.00 TB/1.81 TiB)
[  746.012294] sd 1:0:0:0: [sda] Write Protect is off
[  746.012320] sd 1:0:0:0: [sda] Mode Sense: 47 00 10 08
[  746.012878] sd 1:0:0:0: [sda] No Caching mode page found
[  746.012903] sd 1:0:0:0: [sda] Assuming drive cache: write through
[  746.014071] sd 1:0:0:0: Attached scsi generic sg0 type 0
[  749.065966]  sda: sda1
[  749.070443] scsi 1:0:0:1: Enclosure         WD       SES Device       1012 PQ: 0 ANSI: 6
[  749.072450] sd 1:0:0:0: [sda] Attached SCSI disk
[  749.076088] scsi 1:0:0:1: Attached scsi generic sg1 type 13
[ 1154.811512] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 1154.812659] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 1154.813625] EXT4-fs (sda): VFS: Can't find ext4 filesystem
[ 1154.814528] FAT-fs (sda): invalid media value (0xb9)
[ 1154.814544] FAT-fs (sda): Can't find a valid FAT filesystem
[ 1154.815472] FAT-fs (sda): invalid media value (0xb9)
[ 1154.815488] FAT-fs (sda): Can't find a valid FAT filesystem
[ 1154.816481] F2FS-fs (sda): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[ 1154.816499] F2FS-fs (sda): Can't find valid F2FS filesystem in 1th superblock
[ 1154.816940] F2FS-fs (sda): Magic Mismatch, valid(0xf2f52010) - read(0x627a2a7a)
[ 1154.816957] F2FS-fs (sda): Can't find valid F2FS filesystem in 2th superblock
[ 1154.816978] F2FS-fs (sda): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[ 1154.816992] F2FS-fs (sda): Can't find valid F2FS filesystem in 1th superblock
[ 1154.817008] F2FS-fs (sda): Magic Mismatch, valid(0xf2f52010) - read(0x627a2a7a)
[ 1154.817021] F2FS-fs (sda): Can't find valid F2FS filesystem in 2th superblock
[ 1277.960967]  sda: sda1
[ 1821.926378]  sda: unknown partition table
[ 1957.365575]  sda: unknown partition table
[ 3180.385187]  sda: unknown partition table
[ 3683.517071]  sda: unknown partition table

cschwing
Posts: 4
Joined: Wed Jul 15, 2015 9:21 pm

Re: Trying to mount a hard drive to the pi

Thu Jul 16, 2015 2:54 pm

I solved it. After deleting all the partitions, I had to press o to make a new DOS partition table, then make new partitions. Before I just went straight to making new ones.

Tom_A
Posts: 272
Joined: Fri Dec 06, 2013 8:34 am

Re: Trying to mount a hard drive to the pi

Thu Jul 16, 2015 3:06 pm

cschwing wrote:I solved it. After deleting all the partitions, I had to press o to make a new DOS partition table, then make new partitions. Before I just went straight to making new ones.
I used gparted to change my drive to ext4. I understand that some people like to use the command line for these things, but I've found that it's less likely for problems like this to come up when using the GUI as it will often take care of things like this automatically. I did this using Ubuntu on another computer, however I do have gparted installed on at least one of my Pi's. I also use grsync instead of just rsync and find this a little easier to verify that I'm cloning the correct drive to the correct destination drive.

Return to “Troubleshooting”