Jump to content

Cant get USB expansion to work HELP!


Recommended Posts

Ive configured the 4 gb USB from the hakshop and the pineapple fstab as per Darrens Specifications in the Forum guide (http://forums.hak5.o...swap-partition/) . The USB is partitioned 80-20 split both are Ext4. When i plug the USB into the pineapple the USB light turns on and its visible via lsusb command. But when i SSH in and issue the mkswap /dev/sda2 command it returns

root@Pineapple:~# mkswap /dev/sda2

/dev/sda2: No such file or directory
be my knight in shining armor,
-SM
Link to comment
Share on other sites

Follow this:

http://forums.hak5.org/index.php?showtopic=25882

Make sure you change the swap to "1".

Thats the guide I said i was following already above. I have all those settings in the fstab configured. Any other suggestions?

Are you sure you used the

mkswap /dev/sda2

command?

Did you reboot your pineapple afterwards?

Yes I did. Thats my actual output above. The problem is that I shouldn't be getting a "no such file or Directory" in response to the command.

Link to comment
Share on other sites

you're right if lsusb lists the device it knows it's there, but it might not now what to do with it.

Lets try this:

after your pineapple has booted remove and reinsert the thumb drive and then do

dmesg | tail -f 50

you might see stuff that is irrelevant but eventually you'll see a line saying that you removed the USB device and then a lot of output referring to when you plugged it back in.

if you could paste that dmesg output here we might get a few more clues as to what is happening.

(I think that poster before me was trying to ask what brand/model/size thumb drive you're using)

Edited by sygo
Link to comment
Share on other sites

you're right if lsusb lists the device it knows it's there, but it might not now what to do with it.

Lets try this:

after your pineapple has booted remove and reinsert the thumb drive and then do

dmesg | tail -f 50

you might see stuff that is irrelevant but eventually you'll see a line saying that you removed the USB device and then a lot of output referring to when you plugged it back in.

if you could paste that dmesg output here we might get a few more clues as to what is happening.

(I think that poster before me was trying to ask what brand/model/size thumb drive you're using)

Booted Pineapple. Let it settle. Then Unplugged USB for 5 seconds, plugged it back in and then..

root@Pineapple:~# dmesg | tail -f 50
tail: can't open '50': No such file or directory
tail: no files
AHHHHHH I just want something to work!!!

Have you tried using a different flash drive? I have found that certain drives have trouble with the pineapple.

Yea Ive tried like 4 different USBs, all ones that ive seen working for other pineapples. Mostly SanDisk Cruizer 4 GB and 16 GB.

Anyone who feels like they have some ideas and are down to try it over the phone let me know and ill message you my #. If the problem gets resolved ill post it up here after. Otherwise keep the suggestions coming fellas. Dont give up on me.

Link to comment
Share on other sites

That was totally my bad.

The command should be

dmesg | tail -n 50

(-f is something totally different...all I want is the last 50 lines of your dmesg after you plug in the drive, so if all else fails type in dmesg and copy paste everything after "USB disconnected" or something along those lines)

if you've pugged in several drives with the same result I suspect the problem might be the way you are setting up the drive...especially on the red hat box...it should recognize pretty much anything.

Link to comment
Share on other sites


root@Pineapple:~# dmesg | tail -n 50



[ 35.470000] Button Hotplug driver version 0.4.1

[ 35.710000] RPC: Registered named UNIX socket transport module.

[ 35.720000] RPC: Registered udp transport module.

[ 35.720000] RPC: Registered tcp transport module.

[ 35.730000] RPC: Registered tcp NFSv4.1 backchannel transport module.

[ 36.090000] PPP generic driver version 2.4.2

[ 36.220000] tun: Universal TUN/TAP device driver, 1.6

[ 36.220000] tun: © 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

[ 36.480000] ip_tables: © 2000-2006 Netfilter Core Team

[ 36.730000] NET: Registered protocol family 24

[ 36.870000] nf_conntrack version 0.5.0 (458 buckets, 1832 max)

[ 37.690000] xt_time: kernel timezone is -0000

[ 38.080000] usbcore: registered new interface driver ath9k_htc

[ 38.250000] usbcore: registered new interface driver usbserial

[ 38.260000] usbcore: registered new interface driver usbserial_generic

[ 38.260000] usbserial: USB Serial support registered for generic

[ 38.300000] usbcore: registered new interface driver cdc_ether

[ 38.410000] Error: Driver 'gpio-keys-polled' is already registered, aborting...

[ 38.540000] usbcore: registered new interface driver rndis_host

[ 38.670000] sd 0:0:0:0: Attached scsi generic sg0 type 0

[ 45.080000] device eth0 entered promiscuous mode

[ 52.070000] device wlan0 entered promiscuous mode

[ 52.120000] br-lan: port 2(wlan0) entered forwarding state

[ 52.130000] br-lan: port 2(wlan0) entered forwarding state

[ 54.130000] br-lan: port 2(wlan0) entered forwarding state

[ 62.860000] device wlan0 left promiscuous mode

[ 62.860000] br-lan: port 2(wlan0) entered disabled state

[ 64.160000] device wlan0 entered promiscuous mode

[ 64.320000] br-lan: port 2(wlan0) entered forwarding state

[ 64.320000] br-lan: port 2(wlan0) entered forwarding state

[ 66.320000] br-lan: port 2(wlan0) entered forwarding state

[ 176.900000] usb 1-1: USB disconnect, device number 2

[ 179.700000] usb 1-1: new high-speed USB device number 3 using ehci-platform

[ 179.860000] scsi1 : usb-storage 1-1:1.0

[ 180.860000] scsi 1:0:0:0: Direct-Access SanDisk Firebird 1.07 PQ: 0 ANSI: 2

[ 180.860000] sd 1:0:0:0: Attached scsi generic sg0 type 0

[ 180.880000] sd 1:0:0:0: [sda] 131072 512-byte logical blocks: (67.1 MB/64.0 MiB)

[ 180.880000] sd 1:0:0:0: [sda] Write Protect is off

[ 180.890000] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00

[ 180.890000] sd 1:0:0:0: [sda] No Caching mode page present

[ 180.890000] sd 1:0:0:0: [sda] Assuming drive cache: write through

[ 181.000000] sd 1:0:0:0: ioctl_internal_command return code = 8070000

[ 181.000000] : Sense Key : 0x4 [current]

[ 181.010000] : ASC=0x0 ASCQ=0x0

[ 181.010000] sd 1:0:0:0: [sda] No Caching mode page present

[ 181.020000] sd 1:0:0:0: [sda] Assuming drive cache: write through

[ 181.020000] sda: unknown partition table

[ 181.030000] sd 1:0:0:0: [sda] No Caching mode page present

[ 181.040000] sd 1:0:0:0: [sda] Assuming drive cache: write through

[ 181.040000] sd 1:0:0:0: [sda] Attached SCSI removable disk



When i issue ls dev/sd* cmd without the USB plugged in i get



root@Pineapple:~# ls /dev/sd*

ls: /dev/sd*: No such file or directory


But if i do it with the USB plugged in...



root@Pineapple:~# ls /dev/sd*

/dev/sda


Should I just issue the mkswap /dev/sda ? I dont want to do it without asking around for risk of screwing things up further. Shouldn't there be two different results since the drive is partitioned? Just wondering.


Let me know what ppl think. PLEASE



Edited by Scanner Martel
Link to comment
Share on other sites

check it out:

[ 181.020000] sda: unknown partition table

your pineapple isn't happy with that partition table.

Can you try going through the motions again and go through that initial post you mention with the tutorial to create the thumb drive?

Caveats to look for:

- that "take ownership" check box...it HAS to be off.

- make sure that those changes to fstab are exactly the same

and just to be extra paranoid: could you use the wall brick to feed power to the pineapple while we're troubleshooting this? feeding it power via USB is cool on the run, but if you're at your desk (or whatever) the external power supply won't hurt one bit.

Link to comment
Share on other sites

My fstab..

config global automount
option from_fstab 1
option anon_mount 1
config global autoswap
option from_fstab 1
option anon_swap 1
config mount
option target /usb
option device /dev/sda1
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0
config swap
option device /dev/sda2
option enabled 1
Reformatted. Absolutely unchecked the take ownership. Using non battery power.
No luck. AHHHHHHH
Link to comment
Share on other sites

the fact that in /dev you have a device called sda is half of the problem solved, but now you need to figure out why it's not seeing/mounting any partitions.

mkswap /dev/sda won't do much because you're telling it to make swap space not on a partition, but on the device itself.

what you need is something like mkswap /dev/sda2 (that means, device 'a' on partition '2' of that same device)

I'm going to do a quick tutorial on how to set all of this up using the command line, once you go though that lets see if the problem persists.

give me a few minutes and I'll get back to you.

Link to comment
Share on other sites

More info from dmesg. This time i booted without the USB plugged in then plugged it in and dmesg | tail -n 50. this was what i got

root@Pineapple:~# dmesg | tail -n 50
[ 36.710000] NET: Registered protocol family 24
[ 36.850000] nf_conntrack version 0.5.0 (458 buckets, 1832 max)
[ 37.670000] xt_time: kernel timezone is -0000
[ 38.060000] usbcore: registered new interface driver ath9k_htc
[ 38.230000] usbcore: registered new interface driver usbserial
[ 38.230000] usbcore: registered new interface driver usbserial_generic
[ 38.240000] usbserial: USB Serial support registered for generic
[ 38.280000] usbcore: registered new interface driver cdc_ether
[ 38.390000] Error: Driver 'gpio-keys-polled' is already registered, aborting...
[ 38.520000] usbcore: registered new interface driver rndis_host
[ 45.030000] device eth0 entered promiscuous mode
[ 51.860000] device wlan0 entered promiscuous mode
[ 51.930000] br-lan: port 2(wlan0) entered forwarding state
[ 51.940000] br-lan: port 2(wlan0) entered forwarding state
[ 53.940000] br-lan: port 2(wlan0) entered forwarding state
[ 62.530000] device wlan0 left promiscuous mode
[ 62.530000] br-lan: port 2(wlan0) entered disabled state
[ 63.830000] device wlan0 entered promiscuous mode
[ 63.990000] br-lan: port 2(wlan0) entered forwarding state
[ 64.000000] br-lan: port 2(wlan0) entered forwarding state
[ 66.000000] br-lan: port 2(wlan0) entered forwarding state
[ 177.040000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 177.260000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 177.480000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 177.700000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 177.920000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 178.140000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 178.360000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 178.580000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 178.800000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 179.020000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 179.240000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 179.460000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 179.680000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 179.900000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 180.120000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 180.340000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 180.560000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 180.780000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 181.000000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 181.220000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 181.440000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 181.660000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 181.880000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 182.100000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 182.320000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 182.540000] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 182.820000] usb 1-1: new high-speed USB device number 28 using ehci-platform
[ 182.950000] usb 1-1: device descriptor read/64, error -71
[ 183.210000] hub 1-0:1.0: unable to enumerate USB device on port 1
Not sure if this is helpful. just havent seen it before so thought id throw it up
Edited by Scanner Martel
Link to comment
Share on other sites

Ready for this? Commands in bold. -- actually the forum ate my bolds... you'll figure it out right?

get to your linux box, plug in your thumb drive.

1 -- Lets figure out what device the thumbdrive is associated with

[xetic@board][0][~]> cat /proc/partitions
major minor  #blocks  name
 
   8        0   58605120 sda
   8        1     248832 sda1
   8        2          1 sda2
   8        5   58353664 sda5
 254        0   58352636 dm-0
 254        1   56328192 dm-1
 254        2    2023424 dm-2
   8       16    3910656 sdb
   8       17    3910640 sdb1

the last device on that list is sdb, fairly safe to assume that's it. But your milage may vary, so adapt accordingly, it might be sdc, sdd... etc. and if it's something other than sdb, make sure you substitute sdb in every command below to reflect your setup.

(sudo every command or 'su -i' from now on to get the rest of this done)

2 -- lets partition the device with fdisk:

root@board:/home/xetic# fdisk /dev/sdb
 
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

3 -- lets delete all the partions currently there, I only have one because its a brand spanking new flash drive, you might have more, repeat the 'd' command and increment the partition number until there's none left:

(the first command 'p' will print all your partitions)

Command (m for help): p                                                                                  
 
Disk /dev/sdb: 4004 MB, 4004511744 bytes
116 heads, 51 sectors/track, 1322 cylinders
Units = cylinders of 5916 * 512 = 3028992 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1323     3910640    b  W95 FAT32
 
Command (m for help): d
Selected partition 1

4 -- Let's create new partitions, this is a 4gb sundisk, so there no reason not to copy this verbatim:

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1322, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1322, default 1322): +3G
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1065-1322, default 1065):
Using default value 1065
Last cylinder, +cylinders or +size{K,M,G} (1065-1322, default 1322): <just press enter>
Using default value 1322 

5 -- Lets mark the second partiton as a swap partition, use the 't' command and pick hexcode 82:

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)

6 -- Lets print it again and see if it looks good and procede to save (w) and quit (q):

Command (m for help): p
 
Disk /dev/sdb: 4004 MB, 4004511744 bytes
116 heads, 51 sectors/track, 1322 cylinders
Units = cylinders of 5916 * 512 = 3028992 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1064     3147286+  83  Linux
/dev/sdb2            1065        1322      763164   82  Linux swap / Solaris
 
Command (m for help): wq
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
 
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

Epic... now... I forgot to dismount the drive to begin with, it's all good...lets do it now:

root@board:/home/xetic# umount /dev/sdb1

7 -- lets create the ext4 filesystem on it

root@board:/home/xetic# mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244800 inodes, 977660 blocks
48883 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1002438656
30 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736
 
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

8 -- Lets create the swap partition:

root@board:/home/xetic# mkswap /dev/sdb2
Setting up swapspace version 1, size = 763160 KiB
no label, UUID=831002c2-e123-4018-90ab-a4c7ca116935

We're done!

turn off the pineapple, slap the flashdrive on it, boot it up.

try the 'free' command, also 'df -h' on the pinapple.

Huge Success??

Edited by sygo
Link to comment
Share on other sites

Ok road bump but I think this is on the right track. Heres where im hitting a snag

i get into fdisk. it shows 2 partitions sdb1 and sdb2

delete one and two just fine.

Command: n

select 'p' with value 1

heres where im diverging.

instead of

First cylinder (1-1322, default 1):

Which is what you have. Im showing

First sector (2048-7821311, default 2048):

Im assuming this is where the partition is supposed to start or something? is this a problem? I tried running through just ignoring this difference and I got an error when trying to create the EXT4 file sys. it said

mkfs.ext4: inode_size (128) * inodes_counts (0) too big for a filesystem with 0 blocks, specify higher inode_ratio (-i) or lower inode count (-N)

This is kinda confusing for me so if im not being clear or providing enough info let me know and ill try to give you a better view of whats going on. I really appreciate all your help. That tutorial is freaking awesome. I think if we get this kink worked out this could work.

let me know,

-SM

Edited by Scanner Martel
Link to comment
Share on other sites

I'm shooting in the dark, but when you start the fdisk part press c before doing anything, that will toggle the DOS compatibility mode.

might be worth a shot.

if that fails try using cfdisk (same concept: sudo cfdisk /dev/sdb). It's a bit more modern than fdisk and you might get better results, it's menu based so it's hard to explain how to do stuff, but I'm sure you'll figure it out. Delete whatever is there and create everything again. Make sure the FS type is Linux and swap for sdb1 and sdb2, respectively.

Edited by sygo
Link to comment
Share on other sites

Somehow I finally got the Sandisk 4Gb stick to work using the wall power cable. Is that a flaw in the Pineapple that it does not work with battery power or the USB power connection? I checked the volts of the USB accessory port with it plugged it into the laptop and got 4.1 volts, then I got 5.2 volts with it plugged into the wall. The Pineapple recognized the the 4Gb USB when it's plugged in, but is not able to mount it when it has USB power.

Link to comment
Share on other sites

the sandisk 4gb should work with no problems at all with the pineapple powered via USB.

you might want to measure the output of that usb port (if its a laptop some ports could be a little under 5, if it's a non powered hub and you have a few devices connected you might also notice a decrease in power being delivered)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...