Monday, April 28, 2025

How to Mount Android phone as Flash Drive in OpenBSD

If you need to transfer some files to OpenBSD box from cell phone/flash/card.

But before everything:

Please, be sure that your mem.card/flash/external disk is properly pluged in USB/sock/whatever.

First I will make "htc" directory in /mnt:

#pwd
/mnt
#mkdir htc

Is directory there ?

#ls
htc

Ok. Let plug device into USB port. Here is report from console:

umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2targets, inititor 0
sd0 at scsibus1 targ 1 lun0: <HTC, Android Phone, 0100> SCSI2 0/direct removable
sd0: drive offline

So far, so good. Now, run disklabel sd0:

#disklabel sd0

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Android Phone   
uid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 240
total sectors: 3862528
boundstart: 0
boundend: 3862528
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:          3862528                0  unused                   
  i:          3862399              129   MSDOS                   

What we have ? fstype is MSDOS :) , and sd0 goes sd0i ( i = partition, see above).

Mounting:

#mount -t msdos /dev/sd0i /mnt/htc

Check:

#mount:

/dev/wd0a on / type ffs (local)
/dev/wd0k on /home type ffs (local, nodev, nosuid)
/dev/wd0d on /tmp type ffs (local, nodev, nosuid)
/dev/wd0f on /usr type ffs (local, nodev)
/dev/wd0g on /usr/X11R6 type ffs (local, nodev)
/dev/wd0h on /usr/local type ffs (local, nodev)
/dev/wd0j on /usr/obj type ffs (local, nodev, nosuid)
/dev/wd0i on /usr/src type ffs (local, nodev, nosuid)
/dev/wd0e on /var type ffs (local, nodev, nosuid)
/dev/sd0i on /mnt/htc type msdos (local)

That's it.  Now, do what you need to do with your data in /mnt/htc or some other dir...

For sure, check your local man mount/umount page.

No comments:

Post a Comment

Tkinter Introduction - Top Widget, Method, Button

First, let's make shure that our tkinter module is working ok with simple  for loop that will spawn 5 instances of blank Tk window .  ...