Jump to content

[How-to] Enable Usb Mass Storage With Swap Partition


Recommended Posts

This tutorial applies to the WiFi Pineapple Mark IV.

1. Partition and format your USB Flash Disk. We'll be using the 4GB SanDisk Cruzer Fit (Available in the HakShop /shameless plug)

a. Using Ubuntu open Disk Utility from System > Admin.

b. Unmount any mounted existing volumes

c. Delete any existing partitions. You should now have a blank drive with no partitions as seen below.

6844777856_7f35cdfddd.jpg

d. Create your first partition using the Create Partition button and make the partition take 80% of the available space. The unused space will be used for your swap partition. Make sure to uncheck the box regarding taking ownership and select EXT4 as the filesystem.

6844777842_c609b2328b.jpg

e. Repeat the previous step using the last available space, unchecking the ownership box and selecting EXT4 as the FS. Name the partitions whatever you like.

6844777844_272ee49f82.jpg

f. Your drive show look like the below image. Remove the USB drive from your Linux box.

6844777858_4edef31299.jpg

2. Configure the Swap partition on your WiFi Pineapple

a. On the WiFi Pineapple's Web UI browse the the USB page and ensure that your config looks like the one below.

6844777852_1f76020b2d.jpg


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

b. Plug in the USB drive and wait a minute for everything to settle.

c. SSH into the WiFi Pineapple (typically "ssh root@172.16.42.1")

d. Issue "mkswap /dev/sda2"

root@Pineapple:~# mkswap /dev/sda2
Setting up swapspace version 1, size = 1003741 kB
no label, UUID=97996185-a731-4d1e-92d8-1017fdb3603e

e. Reboot the WiFi Pineapple by issuing "reboot"

3. Verify that swap space has been enabled

a. From the Advanced page issue the command "free"

6844777850_41bf8bc954.jpg

More reading on fstab in openwrt: http://wiki.openwrt.org/doc/uci/fstab

Installing packages to the USB partition:

Your /etc/opkg.conf file should look like the below. You can verify by issuing "cat /etc/opkg.conf" from a SSH session or from the Advanced pages execute commands box.

dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
dest usb /usb 

Update opkg by issuing "opkg update" (Internet connection required so enable 3G or Tether)

Install packages using the syntax "opkg install --dest usb packagename"

Thoughts?

When i am using san disk cruzer, its not working. But when i used other pd it worked. Please help me.

with cruzer ls in /dev/ shows sda and sg0

and

when i used the other it showed me sda1 and sda2.

what could be the problem ?

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 100
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hi all. My .02c.

MK4, elite bundle, 4gb fit, linux ext4 way -> dmesg: /dev/sda unknown partition table.

Powered from 12v etc.

SOLUTION! Using gnome-disk-util again, i erased/reformated BUT with GUID partition table instead of MBR. It works now.

And yes, other USB sticks work fine with MBR, but for some reason 4gb Fit i got in bundle is NOT.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Hi! This problem has not been solved up to now?

I have 4GB SanDisk Cruzer Fit from hackshop. I tried partition and format (minitool partition, gparted, fdisk, win 7 tool, gnome-disk-tool on ubuntu 12.10, backtrack5r2) on guide Darren and Spikey D, but the symptoms are the same as described in the topic :( In ubuntu and windows over extfs - this usb mount and work correctly.

I test this problem on 2.7.0 and 2.7.7

00:11:58 Pineapple kern.notice kernel: [ 2619.820000] sd 5:0:0:0: [sda] Attached SCSI removable disk
00:11:58 Pineapple kern.info kernel: [ 2619.800000] sda: unknown partition table
00:11:58 Pineapple kern.info kernel: [ 2619.790000] : ASC=0x0 ASCQ=0x0
00:11:58 Pineapple kern.info kernel: [ 2619.780000] sd 5:0:0:0: ioctl_internal_command return code = 8070000
00:11:58 Pineapple kern.info kernel: [ 2619.780000] : Sense Key : 0x4 [current]
00:11:58 Pineapple kern.err kernel: [ 2619.820000] sd 5:0:0:0: [sda] Assuming drive cache: write through
00:11:58 Pineapple kern.err kernel: [ 2619.810000] sd 5:0:0:0: [sda] No Caching mode page present
00:11:58 Pineapple kern.err kernel: [ 2619.800000] sd 5:0:0:0: [sda] Assuming drive cache: write through
00:11:58 Pineapple kern.err kernel: [ 2619.790000] sd 5:0:0:0: [sda] No Caching mode page present
00:11:57 Pineapple user.notice usb-modeswitch: 1-1:1.0: Manufacturer=SanDisk_Corporation Product=Firebird6Sp9 Serial=0123456789ABCDEF
00:11:57 Pineapple kern.notice kernel: [ 2619.660000] sd 5:0:0:0: [sda] Write Protect is off
00:11:57 Pineapple kern.notice kernel: [ 2619.660000] sd 5:0:0:0: [sda] 131072 512-byte logical blocks: (67.1 MB/64.0 MiB)
00:11:57 Pineapple kern.notice kernel: [ 2619.640000] sd 5:0:0:0: Attached scsi generic sg0 type 0
00:11:57 Pineapple kern.notice kernel: [ 2619.640000] scsi 5:0:0:0: Direct-Access SanDisk Firebird 1.07 PQ: 0 ANSI: 2
00:11:57 Pineapple kern.err kernel: [ 2619.670000] sd 5:0:0:0: [sda] No Caching mode page present
00:11:57 Pineapple kern.err kernel: [ 2619.670000] sd 5:0:0:0: [sda] Assuming drive cache: write through
00:11:57 Pineapple kern.debug kernel: [ 2619.670000] sd 5:0:0:0: [sda] Mode Sense: 03 00 00 00
00:11:56 Pineapple kern.info kernel: [ 2618.640000] scsi5 : usb-storage 1-1:1.0
00:11:56 Pineapple kern.info kernel: [ 2618.490000] usb 1-1: new high-speed USB device number 7 using ehci-platform

fstab config from web

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

P.S. i tried format and partition with Corsair Voyager GT 30Gb and result - success mounted to pineapple and created swap.

Wtf - what with 4GB SanDisk Cruzer Fit (from hackshop!) and pineaple?! Incompatibility or bug?!

Edited by Olesya
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hey, complete pineapple noob here. Very inexperienced with Linux (I've only dipped my toes in the water in past) but following instructions/tutorials isn't a big deal.

I'll detail my setup and then describe my problem.

  • Pineapple Hardware Version: MK4
  • Pineapple Software Version: 2.7.0 out of the box (haven't upgraded just yet because I was reading about Karma issues with 2.8.0)
  • OS used to connect to the pineapple: Kali Linux
  • Network layout of how your setup is connected: Pineapple on AC power is ethernet tethered to Linux laptop, which is in turn connected by wifi to my router. I also have a win7 laptop connected to the router by ethernet.
  • All the tools/options that are running on the pineapple when the issue happened: I disabled all services while I was setting up the USB
  • Ping results from computer to pineapple: "64 bytes from 172.16.42.1: icmp_req=4 ttl=64 time=0.167 ms

I was following Darren's tutorial at the start of the thread, I'm using a Sandisk Cruzer Switch 4gb. I used GParted for the partitions, verified that the swap space had been enabled by executing the 'free' command on the advanced tab of the UI and then I got to this part:

Installing packages to the USB partition:

Your /etc/opkg.conf file should look like the below. You can verify by issuing "cat /etc/opkg.conf" from a SSH session or from the Advanced pages execute commands box.

dest root /
dest ram /tmp
lists_dir ext
/var/opkg-lists
option overlay_root
/overlay
dest usb
/usb

Update opkg by issuing "opkg update" (Internet connection required so enable 3G or Tether)

I ssh'd into the pineapple and issued "cat /etc/opkg.conf" and got this:

root@Pineapple:~# cat /etc/opkg.conf
src/gz snapshots http://cloud.wifipineapple.com/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
dest usb /home < This is the first thing I'm not sure about as it isn't in the above - I saw someone else had raised it in this thread but I couldn't find any response to
his post.
dest usb /usb

Then I went to update opkg by issuing "opkg update" and got this:

root@Pineapple:~# opkg update
Downloading http://cloud.wifipineapple.com/packages/Packages.gz.
wget: bad address 'cloud.wifipineapple.com'
Collected errors:
* opkg_download: Failed to download http://cloud.wifipineapple.com/packages/Packages.gz, wget returned 1.
root@Pineapple:~#

So...

Is that line "dest usb /home" a problem? And what's up with opkg update?

EDIT: The "opkg update" issue was a connection problem. I had unwittingly messed up the iptables when creating an new wireless network earlier. I fixed it by running wp4.sh again. Packages have now updated successfully.

Any help is greatly appreciated,

Cheers

Edited by JoeBloe84
Link to comment
Share on other sites

  • 2 weeks later...

Hey I got a sandisk cruzer fit 4 gb usb with a bad partition or something.

The partition program can see the partitions that already are on the drive, but it can't access or delete the partitions.

When I try to format it the program will just crash or it will say:

This usb drive can't be formatted.

Here is a output from Parted magic on UBCD boot cd:

GParted 0.9.0

Libparted 2.3

Delete /dev/sdb1 (ext4, 2.79 GiB) from /dev/sdb 00:01:52 ( ERROR ) calibrate /dev/sdb1 00:00:00 ( SUCCESS ) path: /dev/sdb1
start: 63
end: 5861422
size: 5861360 (2.79 GiB)
delete partition 00:01:52 ( ERROR ) libparted messages ( INFO ) Input/output error during write on /dev/sdb Error opening /dev/sdb: Resource temporarily unavailable

========================================

Delete /dev/sdb2 (unknown, 956.00 MiB) from /dev/sdb

========================================

Hope someone can help me!

Link to comment
Share on other sites

Hey I got a sandisk cruzer fit 4 gb usb with a bad partition or something.

The partition program can see the partitions that already are on the drive, but it can't access or delete the partitions.

When I try to format it the program will just crash or it will say:

This usb drive can't be formatted.

Here is a output from Parted magic on UBCD boot cd:

GParted 0.9.0

Libparted 2.3

Delete /dev/sdb1 (ext4, 2.79 GiB) from /dev/sdb 00:01:52 ( ERROR ) calibrate /dev/sdb1 00:00:00 ( SUCCESS ) path: /dev/sdb1

start: 63

end: 5861422

size: 5861360 (2.79 GiB) delete partition 00:01:52 ( ERROR ) libparted messages ( INFO ) Input/output error during write on /dev/sdb Error opening /dev/sdb: Resource temporarily unavailable

========================================

Delete /dev/sdb2 (unknown, 956.00 MiB) from /dev/sdb

========================================

Hope someone can help me!

As bad as it sounds, have you tried formatting it in Windows to see if you get the same grief?

If so, what error are you getting?

Link to comment
Share on other sites

Hello I joined since I am having issues as well with a SanDisk USB drive.

I went to my local store and purchased another drive and it works as it should.

Working:

May 23 23:19:41 e-Masheen kernel: [679753.566880] scsi 16:0:0:0: Direct-Access SanDisk Cruzer Glide 1.26 PQ: 0 ANSI: 5
May 23 23:19:41 e-Masheen kernel: [679753.570821] sd 16:0:0:0: [sdd] 7821312 512-byte logical blocks: (4.00 GB/3.72 GiB)
May 23 23:19:41 e-Masheen kernel: [679753.573656] sd 16:0:0:0: [sdd] Write Protect is off
May 23 23:19:41 e-Masheen kernel: [679753.573668] sd 16:0:0:0: [sdd] Mode Sense: 43 00 00 00
May 23 23:19:41 e-Masheen kernel: [679753.574424] sd 16:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
May 23 23:19:41 e-Masheen kernel: [679753.581464] sd 16:0:0:0: Attached scsi generic sg4 type 0
May 23 23:19:41 e-Masheen kernel: [679753.589343] sdd: sdd1
May 23 23:19:41 e-Masheen kernel: [679753.592927] sd 16:0:0:0: [sdd] Attached SCSI removable disk
May 23 23:25:33 e-Masheen kernel: [680105.660864] sdd: detected capacity change from 4004511744 to 0
May 23 23:25:43 e-Masheen kernel: [680115.623203] usb 1-10: USB disconnect, device number 36

Non-Working:

May 23 23:39:17 e-Masheen kernel: [680929.329203] scsi 20:0:0:0: Direct-Access SanDisk Firebird 1.07 PQ: 0 ANSI: 2
May 23 23:39:17 e-Masheen kernel: [680929.333701] sd 20:0:0:0: Attached scsi generic sg4 type 0
May 23 23:39:17 e-Masheen kernel: [680929.336552] sd 20:0:0:0: [sdd] 131072 512-byte logical blocks: (67.1 MB/64.0 MiB)
May 23 23:39:17 e-Masheen kernel: [680929.338570] sd 20:0:0:0: [sdd] Write Protect is off
May 23 23:39:17 e-Masheen kernel: [680929.338582] sd 20:0:0:0: [sdd] Mode Sense: 03 00 00 00
May 23 23:39:17 e-Masheen kernel: [680929.341906] sd 20:0:0:0: [sdd] No Caching mode page present
May 23 23:39:17 e-Masheen kernel: [680929.341917] sd 20:0:0:0: [sdd] Assuming drive cache: write through
May 23 23:39:17 e-Masheen kernel: [680929.381172] sd 20:0:0:0: ioctl_internal_command return code = 8070000
May 23 23:39:17 e-Masheen kernel: [680929.381177] : Sense Key : Hardware Error [current]
May 23 23:39:17 e-Masheen kernel: [680929.381182] : Add. Sense: No additional sense information
May 23 23:39:17 e-Masheen kernel: [680929.387629] sd 20:0:0:0: [sdd] No Caching mode page present
May 23 23:39:17 e-Masheen kernel: [680929.387634] sd 20:0:0:0: [sdd] Assuming drive cache: write through
May 23 23:39:17 e-Masheen kernel: [680929.390995] sdd: unknown partition table
May 23 23:39:17 e-Masheen kernel: [680929.394213] sd 20:0:0:0: [sdd] No Caching mode page present
May 23 23:39:17 e-Masheen kernel: [680929.394219] sd 20:0:0:0: [sdd] Assuming drive cache: write through
May 23 23:39:17 e-Masheen kernel: [680929.394222] sd 20:0:0:0: [sdd] Attached SCSI removable disk
May 23 23:39:17 e-Masheen kernel: [680929.437292] sd 20:0:0:0: ioctl_internal_command return code = 8070000
May 23 23:39:17 e-Masheen kernel: [680929.437297] : Sense Key : Hardware Error [current]
May 23 23:39:17 e-Masheen kernel: [680929.437301] : Add. Sense: No additional sense information

My take is Firebird is a SanDisk internal codename. Similar to a bootstrap or failsafe waiting for a device or program to flash the drive controller hardware. Unfortunately there is no actual hope on the SanDisk forums other than to replace it. The two log files are from identical drives.

I tried every trick that I could find to bring this drive to life but it seems as if it needs a firmware load since the device name is not correct. It is interesting that it is readable and not garbage like the firmware is corrupt.

My 0.02 is to replace the drive.

It would be nice if there was a release from sandisk to flash this device but I don't think their engineering team would ever let that out since some devices use the same chips and the actual disk size is limited by the firmware in the controller.

Edited by atroph
Link to comment
Share on other sites

root@Pineapple:/tmp/opkg-lists# free
total used free shared buffers
Mem: 29340 21888 7452 0 1832
-/+ buffers: 20056 9284
Swap: 2097148 0 2097148
root@Pineapple:/tmp/opkg-lists# opkg install --dest usb pineapple_packages
Unknown package 'pineapple_packages'.
Collected errors:
* opkg_install_cmd: Cannot install package pineapple_packages.
root@Pineapple:/tmp/opkg-lists# ls
pineapple_packages

thats what i get everytime how do i access the usb ? cd /dev/sda1 is it like this ?

Link to comment
Share on other sites

  • 2 weeks later...

Count me as another person who had trouble with a Sandisk Cruzer (Blade 8GB). I created two partitions using fdisk (1st 80% of the disk, 2nd what remained), and then formatted them with ext4.

I put the disk in my pineapple and was able to make use of the swap, but could never get the first partition to mount. As soon as I switched to a 2GB unknown brand disk that I received as a handout, it worked on the first try.

Maybe I'll try again later with the 8GB, but for now, just wanted to report my experience.

Edit: Forgot to say, I'm running firmware version 2.8.1

2nd Edit: The 2GB freebie disk worked for a while, but I really struggled while trying to install the packages required for sslstrip. The packages would seem to install, but when I tried to run things (sslstrip or even just python), I would get really strange errors that turned up nearly no hits when I searched for them in Google. I suspected corruption so I changed the way I was connecting to the internet. When this didn't help, I went out and bought a PNY USB disk. After putting the PNY in, I was able to get sslstrip working on the first try.

Edited by mgraham
Link to comment
Share on other sites

  • 3 weeks later...

good day, is anyone can help me with my pineapple wifi? There is several problems, and one of them is USB Flash drive, I've got 2 san disc crusader fit 4 and 8 gb, but all of them give me same errors, What's the problem?

I'm using last firmware 2.8.1

it seems that problem is here, what that mean?





00:01:35 Pineapple kern.err kernel: [ 27.170000] usb 1-1: device descriptor read/64, error -145

Sometimes it is work good, but I don't understand why... and it is too rarely, 2 times for 3 weeks

seems that the problem was with power, all time I was using it with pineapple juice, but there was not enough power, and usb flash doest work good, then I power it with AC adapter and all works good.

Edited by drix
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...

I do as like in tutorial, but in result I get in "Config swap: option enabled 0"

How to change it to 1?

I am relatively new, and my web interface seems different than videos and screenshots I've seen, but this is how I changed it. BTW, I am using Firmware Version: 3.0.0

  1. On the main page choose "Resources"
  2. Click on the "USB Info" tab
  3. In the "Fstab Configuration:" box, edit the portion you need and click "Update Fstab"
  4. Follow the rest of the directions and that should do it.

Hope it helps!

Edited by seag33k
Link to comment
Share on other sites

  • 1 month later...

my issue: USB storage wont work

length of trouble shooting: over 3 weeks

what works: everything but usb storage

what doesnt work/ what is my problem: when i plug in my usb stick all connections are lost, resulting in my pineapple WPS light flashing. ive had my pineapple for over a month now so i dont know if my return would even be accepted. i actually dont want to return it, i want to use it.

i will walk through what ive done in order to trouble shoot.

first and foremost ive read and re-read the tutorial on this thread. i have also read ALL comments in this thread. i even went so far to purchase the recommended USB hub that doesnt draw power from pineapple (the dlink mentioned early in some of the comments) as well as the sandisk cruzer fit 4gb. everything works until the usb is plugged into the usb port. once that happens, all connections lights disappear, power light remains, then the WPS light blinks. i cant connect to this via ethernet, wireless, etc.

ive feel like ive done some extensive trouble shooting after reading these comments. ive reset the pineapple twice, however still experience my pineapple being crippled once i connect it using the usb. i apologize if this is too detailed however wanted to make sure i have explained the scenarios that weve tested

pineapple powered via original power adapter (firmware 3.0):

- pineapple mark 4: usb port is not used. only power and data are connecting to the device. everything is factory settings, firmware 3.0

- usb stick: sandisk fit cruzer 4gb

- network: pineapple> ethernet to desktop> desktop receiving data/ internet via wifi adapter. (data via wifi is spotless without any issues) shared internet connections sends data to pineapple. I can access the pineapple via my web browser, access pineapple bar, download the scripts, update my usb script to be set to enabled via the scripts directions from the first couple of pages from the thread.

- all scripts download

- usb stick is formatted correctly, empty, new out of the box

- plug usb in

- all network lights go out

- power light remains on

- WPS button flashes

- this flashing WPS button doesnt stop. i thought perhaps i needed to be patient and let the pineapple think. i have let the pineapple sit over night with the same result.

- when this light flashes, i cant SSH or connect via my browser. im using putty to SSH btw.

before i go into the other scenarios ive done to help trouble shoot my device, i will stop to see if perhaps i am a noob and missed a basic step. has anyone experienced this flashing WPS button that cripples the pineapple? if more information is needed please let me know.

any assistance is appreciated.

Link to comment
Share on other sites

Great writeup!

One thing that helped me though is that when I used a windows utility to format the thumb drive, make sure both partitions are listed as primary. I first tried primary for the data partition and logical for swap, I got errors when issuing the mkswap command. I went back and formatted both as primary and everything worked well.

Thanks again!

Link to comment
Share on other sites

  • 3 months later...

Given that its now a known issue with the hardware build of the IV, im wondering if we are elligle for a full refund?

This is the least i would expect, as i also have spend countless days troubleshooting this issue.

Link to comment
Share on other sites

  • 2 weeks later...

i am not an experienced linux user, i only got this from reading other pages. this also worked for me. mabe you can use this at first if you dont have to do something complicated and just want an extra disk to expand the wifi pineapple memory

1. i make sure that the usb is in the correct format that can be read by the wifi pineapple. the FAT32 and the EXT3 /4 should be cleared at first.which one is suited for markIV

2. i then plug in the usb flash drive (or my wifi dongle with micro SD, both worked well with this procedure). the i type "lsusb" in the advance tab in wifi pineapple . it is like list all the recognized usb device i think. it should show 2 entries, one of which is your usb device.sometimes you have to wait 3 mins for it to be recognized. also, the usb LED light should be steady

3. then i type "mkswap /dev/sda" sometimes it is "mkswap/dev/sda1"

4. then i go to the USB tab in the wifi pineapple, the usb device should show with the available memory. example, if you plug in an 8gig stick, it should show up in that tab

5. then i put the "mkswap/dev/sda" command in the cron tab. i dont know, maybe to make sure that it does that during start up.

I did not mess with any settings at first, and everytime i do, i always keep a back up of the "before" settings and the "after" settings

sorry for the noob explanation. so far it works and i have 8 gig of storage in my wifi mark IV

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.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...