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 April 2016
CristhofferBR CristhofferBR is offline
DOOM listener :)
 
Join Date: Apr 2016
Location: Brasil
Posts: 5
Exclamation [Ajuda]Can't Mounting USB flash drive on OpenBSD.

So.. what's up guys? good dawn for everybody.
First, little history.
A some time ago, i was enjoying pretty happy on my FreeBSD 10.3 in my old laptop with a very low hardware, was a AMD mobile processor that offer to me a 1,60GHz, 412mb of RAM, and 80gb of harddisk, anyway he was my friend and fulfilled his promises, but he died so young.... around 14 years old just because i'm a very lucky guy

With no more funny histories, let me go "almost" directly to the point;
Now i'm with a new hardware "a bit" better than my old friend that passed away so early. But for some reason the universe conspire agaiinst me, because on this new hardware my plug inputs for my wired connection doesn't work since that i got it, so what's the point? make you guys feel bored with the history of my hardwares? (HAHAHA), nono! I'm just tryin to entertain you that is reading because my problem is so simply that i almost feel embarrassed. Continuing... i need to use my wireless device, but BSD offers support to my wireless device? as i was saying in the top, i'm a very lucky guy, so that's the point... my wireless device is an "RTL8188CE 802.11b/g/n WiFi Adapter", that uses the driver "rtwn" to do his magic.
So you guys should be asking "Why this motherfucker doesn't just say, what his problem?" HAHAHA

The problem is that the only BSD Unix that support my wireless device are FreeBSD 11.0 (27 July), and OpenBSD 5.8, 5.9. Yes, i can use Open! but one thing that i didnt tell you guys is that OpenBSD come without the firmware files (rtwn-rtl8192cfwU) to my rtl8188ce (rtwn), now can you understand? you guys: "yeeeeees" HAHA.
Then i found one possibly solution that is copy the firmwares from my USB flash drive, and then install the firmware. (Because i can't do partitioning with success to install the OpenBSD with more than one system, so installed in whole harddrive).
Now without more histories, lets go directly to the point (now is seriously!).

Before, some information:
Quote:
BSD Unix: OpenBSD 5.8.
USB Brand: SanDisk Corporation.
USB flash product: SanDisk Cruzer Blade.
USB device: sd1
USB partition: /dev/rsd1c
USB filesystem partition: ext2
Objective: mount to read.
When i try to mount my pen, i cant. Observe below:
Quote:
BSD4LIFE# mount_ext2 /dev/rsd1c /mnt/pen
mount_ext2 /dev/rsd1c on /mnt/pen: Block device required
That never happened when i tried to mount my USB flash drivers on others BSD Unix, what is it? (Really sorry for my grammar errors, and the inconvenience)

Greetings from BSD Brasil.

Last edited by CristhofferBR; 13th April 2016 at 04:42 AM.
Reply With Quote
  #2   (View Single Post)  
Old 13th April 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Hello, and welcome.

The block device does not use the "r". Also, you must have used mount_ext2fs.

1. If the USB drive has an MBR, containing a single EXT2 partition, OpenBSD would assign this to the virtual disklabel letter "i". The command to mount would be # mount /dev/sd1i /mnt/pen if the /mnt/pen directory already exists. You do not need to use mount_ext2fs(8) directly, because OpenBSD would understand this to be EXT2 based on the MBR partition type.

2. If the USB drive does not have an MBR at all, but only the single EXT2 partition, OpenBSD would not assign any virtual disklabel letter. Instead, you would need to use disklabel letter "c", the disklabel partition letter reserved for an entire drive. And you would need to use mount_ext2fs(8) directly, because there is no pre-defined filesystem type. The command would be # mount_ext2fs /dev/sd1c /mnt/pen

If you are unsure exactly what is on the drive, you can use these two commands, and review the output.

# fdisk sd1 will display the MBR, if there is one.

# disklabel sd1 will display 1) the real disklabel, if there is one, 2) a virtual disklabel, based on any recognized foreign filesystems in the MBR, or c) just the "c" partition information, if there is neither a disklabel nor an MBR on the drive.
Reply With Quote
  #3   (View Single Post)  
Old 13th April 2016
CristhofferBR CristhofferBR is offline
DOOM listener :)
 
Join Date: Apr 2016
Location: Brasil
Posts: 5
Default

Hii
Sorry... i wrote wrong the command's name here.
I tried to mount with "mount" instead mount_ext2fs but happen the same output, so i guess is that have an MBR and maybe i didnt pay due attention.
When i run "disklabel" the output is exactly "rsd1c", but i will review all this later and make sure that is everything ok.

Thanks for you attention by the way, helps me a lot
Reply With Quote
  #4   (View Single Post)  
Old 13th April 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

OpenBSD uses two layers of partitioning. MBR, and disklabel. You must have some understanding of both to get your disk drive mounted.

Disklabel partitions are used on OpenBSD. Always. A drive may have up 15 partitions defined. The letters "a" thru "p" are used. That is 16 letters, but the letter "c" is reserved. It is not a user definable partition. It is just the letter used to define "the disk drive" when used with operational commands.

MBR (or GPT) partitioning is used on some architectures, including amd64 and i386. On an MBR architecture -- such as the hardware you are using -- OpenBSD will look first for a disklabel on a drive. Only if it does not find one, it will look for an MBR (or GPT), to see if there are any recognized foreign file systems. If it finds what may be foreign filesystems in the MBR partition table, it will create a virtual disklabel in memory, and assign disklabel partition letters. These always start with partition letter "i".

A virtual disklabel can become a physical disklabel by being written to disk via the disklabel(8) program.

----------------

Look first at the output of # fdisk sd1

This will tell you, very clearly, if you have an MBR and any MBR partitions defined. The example output in FAQ 14.2 shows a drive with an MBR, with 2 MBR partitions defined.

If you have an MBR partition for your EXT2 filesystem, it will likely be identified as Type 83 - Linux files.

If you do not have an MBR, you may see no partitions defined (such as when there are zeros in the first sector of the drive, or you may see random partition information, based on the values that happen to be in sector 0 of the drive.

---

Look next at the output of # disklabel sd1

You will see 15 lines of configuration information: disk type, label, sector size, and other information. Then there will be a blank line, and then you will see a partition layout. It will begin with:
Code:
16 partitions
After that will come a partition list.

There will always be a partition labelled "c". That is the partition representing the whole drive. It is always shown as "unused".

----

If you have a valid MBR partition, ID 83, you will have an "i" disklabel partition that maps to the same sectors as the MBR partition.

If you do not have an MBR, and the entire drive is an EXT2 partition, you can mount it using the "c" partition -- which represents the entire drive.

I hope I have been clear.
Reply With Quote
  #5   (View Single Post)  
Old 13th April 2016
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by CristhofferBR View Post
When i run "disklabel" the output is exactly "rsd1c", but i will review all this later and make sure that is everything ok.
Please post the entire output of the following command:

# disklabel sd1

...and recognize that '#' above is the shell prompt for root.
Reply With Quote
  #6   (View Single Post)  
Old 14th April 2016
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Welcome!

Quote:
Originally Posted by CristhofferBR View Post
my wireless device is an "RTL8188CE 802.11b/g/n WiFi Adapter", that uses the driver "rtwn" to do his magic. ...

The problem is that the only BSD Unix that support my wireless device are FreeBSD 11.0 (27 July), and OpenBSD 5.8, 5.9.
Just to correct this, rtwn is also available in NetBSD-current. It was ported from OpenBSD.

Last edited by IdOp; 14th April 2016 at 03:31 AM. Reason: fix link
Reply With Quote
  #7   (View Single Post)  
Old 19th April 2016
CristhofferBR CristhofferBR is offline
DOOM listener :)
 
Join Date: Apr 2016
Location: Brasil
Posts: 5
Default

Hello guys, im back (haha). This time with some good news

First i want to thank jggmi for being so attentive with my newbie question. Thanks also to ocicat for readiness to help me, and to ldOp for this precious information, i really dont knew that current NetBSD is compatible with my hardware, thank you too!
Im pretty glad with this forum, here have a lot of really good stuff and people always dispose to help, im improving much more practicing and reading here.

So, i solved my problem reformating my pendrive on Open, copied my firmware files connected to internet from another system, bla bla bla... nothing that i not knew, but i hadnt understood it yet, until few days ago, with the clear answer of jggmi i mounted the right partition of the flash drive, i was doing wrong... anyway, doesnt matter now, im online on my OpenBSD (HAHA), now i can start working. Thank you so much guys
Reply With Quote
  #8   (View Single Post)  
Old 13th June 2016
Nureo Nureo is offline
Sam98
 
Join Date: May 2016
Posts: 24
Default

Hello to everyone!

I am new here. I have solved some problems in OpenBSD by my own, but I don't get what I am doing wrong here.

I have a similar issue.

When I try to mount a USB (msdos), it says the same message: "Block device required".

Why is that? I use this model: "# mount -t msdos /dev/rsd1c /mnt/pen/"

I have information in that USB, so: not possible to be formatted.

I tried with "/dev/rsd1i" and "/dev/rsd1c".

Can someone help me?

Here some important information:

Quote:
# disklabel sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: PenDrive 2.0
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1881
total sectors: 30233588
boundstart: 0
boundend: 30233588
drivedata: 0

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


Thanks for your time!

Last edited by Nureo; 13th June 2016 at 09:46 AM. Reason: Importat information.
Reply With Quote
  #9   (View Single Post)  
Old 13th June 2016
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by Nureo View Post
I use this model: "# mount -t msdos /dev/rsd1c /mnt/pen/"
Given that disklabel(8) says you have partition "i" (In this case, never use partition "c"...), the correct command is:

# mount -t msdos /dev/sd1i /mnt/pen

...assuming /mnt/pen is an empty subdirectory.

Last edited by ocicat; 13th June 2016 at 07:47 PM. Reason: correct shell prompt used
Reply With Quote
Old 13th June 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Hello, and welcome!
  • OpenBSD requires block devices for mounting. Do not use the "r" it defines a raw/character device.
  • You would normally mount the "i" partition. The "c" partition is reserved for the entire, physical device.
However, your disklabel does not appear correct as posted, because the "i" partition begins at sector 0. The only way to have a disklabel such as the one you've posted, is if you used disklabel(8) and created it yourself.

Normally, sector 0 should instead contain an MBR. Operating systems that manage FAT filesystems, including Windows, expect an MBR on FAT formatted devices other than diskettes.

After manually creating the disklabel, did you format the device with newfs_msdos(8)? If so, you can still mount it, but you may have problems when you move the USB device to other systems, as the device does not apparently have an MBR. # mount -t msdos /dev/sd1i /mnt/pen or # mount -t msdos /dev/sd1c /mnt/pen should work if /mnt/pen exists.

---

Your problem is not the same as the original problem posted in this thread, and our forum admins may move this discussion into its own thread to avoid any confusion.

Last edited by jggimi; 13th June 2016 at 10:28 AM. Reason: typo
Reply With Quote
Old 24th June 2016
Nureo Nureo is offline
Sam98
 
Join Date: May 2016
Posts: 24
Default

Well guys. Thank you!

It worked!

For mounting USB devices formatted like MS-DOS (FAT), use this:

Quote:
# mount -t /dev/sd1i /example-folder/example-empty-folder
THIS WORKS ONLY WITH NON PARTITIONED USB DEVICES.

If it does not work with "sd1i", try "sd2i".

For dismount, use:

Quote:
# umount /example-folder/example-empty-folder
Reply With Quote
Reply

Tags
bsd, device, mount, partition, usb

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
Installing OpenBSD from a USB flash drive hanzer Guides 7 14th February 2015 06:42 PM
How do I correctly mount a flash drive in OpenBSD? Justin_i OpenBSD General 5 22nd October 2011 05:01 AM
Mounting/Reading Samsung USB drive Gogglehead FreeBSD General 11 25th February 2011 09:55 PM
Creating USB flash drive drive image from FreeBSD disc1.iso FBSD Guides 1 10th February 2010 04:42 PM
which Flash Drive I must buy for FreeBSD and OpenBSD mfaridi General Hardware 18 22nd October 2008 07:43 PM


All times are GMT. The time now is 11:50 AM.


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