DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th July 2017
acampbell acampbell is offline
Real Name: Anthony Campbell
Fdisk Soldier
 
Join Date: Sep 2014
Location: London, UK
Posts: 80
Default Transferring files to Amazon Kindle

I have attached my Amazon Kindle via usb and want to mount it to allow me to transfer files. The relevant lines in dmesg are:

umass0 at uhub0 port 5 configuration 1 interface 0 "Amazon Amazon Kindle" rev 2.00/1.00 addr 2
umass0: using SCSI over Bulk-Only
scsibus4 at umass0: 2 targets, initiator 0
sd0 at scsibus4 targ 1 lun 0: <Kindle, Internal Storage, 0100> SCSI2 0/direct removable serial.19490004G10571030R3J

I think the kindle is at /dev/sd0c. I tried:

doas mount /dev/sd0c /mnt but this gives:

mount_ffs: /dev/sd0c on /mnt: Invalid argument

I assume it wants a different file system but what should I put?
Reply With Quote
  #2   (View Single Post)  
Old 13th July 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

The "c" partition is incorrect. That's the entire physical drive. Instead, you want the partition letter(s) for the underlying fileystem(s).

When an OpenBSD disklabel does not exist on a drive, OpenBSD creates an in-memory disklabel, scanning the MBR/GPT partition table and placing any recognized partitions in that virtual disklabel, beginning with partition "i".

You can see the list of recognized partitions (usually FAT, also known as "MS-DOS" filesystems) with:

# disklabel sd0

Last edited by jggimi; 13th July 2017 at 02:51 AM. Reason: typo
Reply With Quote
  #3   (View Single Post)  
Old 13th July 2017
GarryR's Avatar
GarryR GarryR is offline
Real Name: Garry Ricketson
Package Pilot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 190
Default

Quote:
I think the kindle is at /dev/sd0c. I tried:
You need to be sure, not just "think".
Also are you running the mount command as root ?

You can make sure if it is sd0c by using 'disklabel' and 'sysctl hw.disknames'
Example:
First
Code:
$ sysctl hw.disknames
hw.disknames=sd0:7c45abe08beb4c01,cd0:,sd1:
Then as root:
Code:
$ su
Password:
# disklabel sd1
You should see some output similar to this:
Code:
16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:       1953525168                0  unused                    
  i:        707256320        177901568  ext2fs                    
  j:        106219520             2048  ext2fs                    
  k:         71680000        106221568  ext2fs                    
  l:         81770496        885159936  ext2fs                    
  m:          9838592        966932480 unknown                    
  n:        976750592        976773120  ext2fs
I am not familiar with "amazon kindle", but usually on all my devices, the sd1i is the
one that is mountable.
Code:
man mount
might help you.
Here is another example using my camera:
Code:
$ sysctl hw.disknames 
hw.disknames=sd0:7c45abe08beb4c01,cd0:,sd1:,cd1:
$ su
Password:
# disklabel sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: Digital Camera  
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 483
total sectors: 7761920
boundstart: 0
boundend: 7761920
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:          7761920                0  unused                    
  i:          7753728             8192   MSDOS                    
#
Again, it is "sd1i" that I need to mount. Hope this helps, I am not very good at explaining things, and also not any expert.
edited , note: almost all ways, the "sdXc" is not what needs to be mounted.
edited again: jggimi answered while I was writing, he is a expert, in any event
the examples, etc,.. may help clarify a little more.
__________________
My best friends are parrots

Last edited by GarryR; 13th July 2017 at 03:05 AM.
Reply With Quote
  #4   (View Single Post)  
Old 13th July 2017
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 533
Default

Does OpenBSD have simple-mtpfs?
I've only used it on FreeBSD, for a Nook, rather than a Kindle, but it would probably work the same way.

A quick google indicates that it exists. So, with the Kindle plugged in and unlocked

simple-mtpfs -l

Should show it.
If so, (and all this needs root, sudo, or doas, including the -l mentioned above--that's a lower case L, for list)
if there are no other devices showing then

simple-mtpfs /mnt

should put it on /mnt.

All untested by me, but that works with a Nook and FreeBSD. I _think_ that Kindles now also use mpt to share files.
Reply With Quote
  #5   (View Single Post)  
Old 13th July 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

Quote:
Originally Posted by scottro View Post
Does OpenBSD have simple-mtpfs?
Yes, but it isn't needed. This Kindle is using umass(4) and attaches as a virtual SCSI device. It behaves just like any USB disk drive.
Code:
scsibus4 at umass0: 2 targets, initiator 0

Last edited by jggimi; 13th July 2017 at 04:12 AM. Reason: clarity
Reply With Quote
  #6   (View Single Post)  
Old 13th July 2017
acampbell acampbell is offline
Real Name: Anthony Campbell
Fdisk Soldier
 
Join Date: Sep 2014
Location: London, UK
Posts: 80
Default

Thanks to everyone for very helpful replies. I've learned a lot, as usual.
The kindle is at /dev/sd0i and I was able to mount it knowing that and to transfer the file.

Thanks for the suggestion of simple-mtpfs, Scottro. It didn't find the device - it said there are no raw devices.
Reply With Quote
  #7   (View Single Post)  
Old 13th July 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

Quote:
Originally Posted by acampbell View Post
It didn't find the device...
It won't, since it attaches as umass(4).

Media Transfer Protocol (MTP) allows for simultaneous storage access by the handheld and the attached workstation. Modern versions of Android have replaced USB mass storage connection with MTP over USB.

https://en.wikipedia.org/wiki/Media_Transfer_Protocol
Reply With Quote
  #8   (View Single Post)  
Old 13th July 2017
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 533
Default

Actually, acampbell, I just came here to mention what you found. I tried it on OpenBSD and it didn't find the device. (Nor did it see the attached Nook as a drive, but as everything else sees it as an mtp device, that wasn't unexpected.)
It does work on Linux on the same machine with simple-mtps.
Reply With Quote
  #9   (View Single Post)  
Old 13th July 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

Scott, consider reporting your experience to Antoine Jacoutot, the port maintainer. His Email address may be found with:

$ pkg_info simple-mtpfs
Reply With Quote
Old 13th July 2017
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 533
Default

Sure, first let me see if that particular machine works with FreeBSD's version. (Which definitely works on other machines).
Between home and work, I have a few machines. I also will have to try the nook with another machine. I'll update in the next day or so.

Ah, actually maybe not till next week, leaving one machine at work for a few things, and the nook is at home and I'm lazy, especially in summer where I'm not wearing a jacket with pockets. (Which would have made it easy to transport the Nook.
Reply With Quote
Old 14th July 2017
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 533
Default

Ok, to follow up. I'm finding that the problem seems to be the Nook. It has a really horrible user interface. When you plug it in, sometimes, it will open a dialog saying use for power or file transfer. If you're not quick, the dialog closes and you can't get it back. According to the manual if you plug it into Windows or Mac it will just show as a drive automatically, but I haven't bothered.

At this point, when I cant' reliably use it on Linux or FreeBSD, I'm not going to follow up with the OpenBSD maintainer. If I start having more consistency with it, I will follow up.
Regardless, thank you for the (as always) very good suggestion.
Reply With Quote
Old 14th July 2017
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 533
Default

And
TL;DR, simple-mtpfs works perfectly in OpenBSD-6.1 on a fairly vanilla machine.

Longer version, the first machine I mentioned is actually running CURRENT, which I'd forgotten--it's on a yoga2 pro, and CURRENT (well, a snapshot from whenever I did it, but sometime after 6.1), is the only version that will boot.

As for the issue with the Nook that I mentioned above, I suspect that originally, I just tapped it when given the option to use the file transfer mode and it didn't stick. When I made sure to hold my finger on the option till it was highlighted, afterwards, OpenBSD-6.1 saw and mounted it without issue.
Reply With Quote
Old 14th July 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

Glad it's working for you, Scott.

Back in the days when MTP applications weren't working for me and my "modern" Android phone of the time, I discovered the Airdroid application. I'm still using that for file transfers and other services, such as sending SMS texts from a real keyboard. There are two modes of operation: on a local wireless network, which they call "lite", and through their central cloud servers, which I have never used.
Reply With Quote
Old 15th July 2017
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 533
Default

To the OP by the way, as was pointed out earlier, MTP is for newer android, and MAYBE newer Kindles, though I'm not sure about that. It's gotten much better over the years, though my CentOS-7 machine still seems to have trouble at times. (And part of this is the Nook's fault, if you miss that dialog to use the connection to transfer files, you sometimes have to reboot the Nook, rather than just remove and replace the cable, to get the dialog back.) (Homer Simpson voice) Stupid Nook!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amazon AWS and SSL certificates Oko General software and network 8 18th April 2015 03:58 AM
To Kindle or not to Kindle that is the question J65nko Off-Topic 14 6th March 2014 03:34 PM
NetBSD now available on Amazon EC2 J65nko News 0 15th March 2011 12:11 AM
Transferring Forum Information JMJ_coder General software and network 2 11th August 2008 09:27 PM
Transferring away from the other site... s2scott Feedback and Suggestions 2 5th May 2008 09:47 AM


All times are GMT. The time now is 05:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick