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 26th May 2020
d31n1 d31n1 is offline
Port Guard
 
Join Date: Jan 2020
Posts: 14
Default How to format USB?

I bought a new laptop today and wanted to see if I could install OpenBSD on it. It worked, but to my dismay I noticed that the laptop has no ethernet port, only wifi card, so my usual way of doing things won't work, which is to connect to the internet with cable and do fw_update to get the necessary firmware.

I do have another laptop and the usb I used to install OpenBSD. I have downloaded the firmwares I need, and now I only need to put it on the usb so that I can install it to my new laptop.

How do I format the usb so that it works as a storage device again? I have tried to google this, but I can't seem to find out what to do, so if anyone here could help I would be very appreciative.
Reply With Quote
  #2   (View Single Post)  
Old 27th May 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Is the other laptop running OpenBSD? If so, here is a step-by-step "howto" ...
  1. Insert the USB storage device into a running OpenBSD system. The kernel will assign the storage device as a pseudo SCSI device, attaching a new sd(4) device number upon insertion. You can find out the device number by watching on the console (or on an xconsole window) as the device is inserted. Device numbers start with 0, and for this howto I will assume the device is sd1, but you must use the device number assigned by the kernel.
  2. Create a new Master Boot Record (MBR) on the storage device. It won't be used for booting, but for reserving an MBR partition which is sized for the entire storage device. # fdisk -i sd1 will do this. You'll be promted to confirm the new MBR and partition table.
  3. Create an OpenBSD disklabel partition "a" that consumes this entire space as well. The disklabel(8) program has an interactive editor that makes this easy. In this example, I've entered the editor using the -E option of the program. I want to (a)dd partition a, so I use "a a", then I respond with the defaults for offset and size, and partition type. The offset will be the start of the defined MBR partition, and the size will be the partition's size. I then use the commands to (w)rite the disklabel and (q)uit the program:
    Code:
    # disklabel -E sd1
    Label editor (enter '?' for help at any prompt)
    vnd0> a a
    offset: [xxx] 
    size: [yyyyyyyy] 
    FS type: [4.2BSD] 
    vnd0*> w
    vnd0> q
    No label changes.
  4. Now I format the newly defined sd1a partition with: # newfs sd1a
  5. Finally, I mount(8) the partition with something like: # mount /dev/sd1a /mnt. In this example I used the /mnt directory, but the choice is yours.
  6. I can copy or move the appropriate firmware tarball to the mounted filesystem in /mnt.
  7. When I'm done with it, I can unmount it with # umount /mnt
When I stick the USB stick into the new laptop, I look for a similar sd number, which for this example will be sd8. As before, use the number the kernel provides.
  1. Mount the partition with something like: # mount /dev/sd8a /mnt.
  2. Run fw_update pointing to the mounted USB device, with something like: # fw_update -p /mnt
Reply With Quote
  #3   (View Single Post)  
Old 27th May 2020
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

I went through this with an HP Stream 14. I used the install67.fs (install67.img) for the initial install and was able to bypass building a ufs2/mbr thumb drive.
Download the wireless firmware from
http://firmware.openbsd.org/firmware/ and save to a vfat/msdos formated usb thumb drive.
While you're downloading, you can also get any needed video/vmm firmware.
Mount the firmware drive
Code:
#mount -t msdos /dev/sd1i /mnt
and then execute the fw_update command with the -p flag as described by @jggimi.

Last edited by shep; 27th May 2020 at 03:12 PM.
Reply With Quote
  #4   (View Single Post)  
Old 27th May 2020
d31n1 d31n1 is offline
Port Guard
 
Join Date: Jan 2020
Posts: 14
Default

Yes, my old laptop is also running OpenBSD. Can't believe I forgot to mention that....
Your solution jggimi worked! Thank you!
My touchpad is not recognized by OpenBSD, so this was all for nothing I guess, but at least I have learned something new.
Not really sure what you meant by "all devices start with 0" though. I used xconsole and none of my deice started with 0, but as long as I understood the next parts its's all good ;P

Could I also use this method to transfer images and videos to my new laptop?
Reply With Quote
  #5   (View Single Post)  
Old 27th May 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Quote:
Originally Posted by d31n1 View Post
My touchpad is not recognized by OpenBSD..
Post your dmesg(8), which may help.
Quote:
Not really sure what you meant by "all devices start with 0" though.
Your first SATA/SCSI drive is sd0, the second is sd1, ... same with all other numbered devices: cpus, acpi controllers, timers, buses, ...
Quote:
Could I also use this method to transfer images and videos to my new laptop?
Sure. You could also put the two laptops on the same network and transfer with innumerable file transfer tools. Since OpenSSH is in-base, you could transfer files with sftp(1), for example.
Reply With Quote
  #6   (View Single Post)  
Old 28th May 2020
victorvas victorvas is offline
Real Name: Victor
Linux
 
Join Date: May 2019
Posts: 148
Default

From what I understand, OpenBSD's FFS2 has journaling of sorts. How do I format my 16GB USB Key using FFS2 without journaling?
In linux with ext4 it would be:
Code:
# mke2fs -t ext4 -O ^has_journal /dev/{your_device_here}
How can I do that in OpenBSD with FFS2?
Reply With Quote
  #7   (View Single Post)  
Old 28th May 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Quote:
Originally Posted by victorvas View Post
From what I understand, OpenBSD's FFS2 has journaling of sorts.
That's not my understanding, but I could always be wrong. An FFS1->FFS2 FAQ was posted both to misc@ and to the OpenBSD Journal, which may help clarify the differences.

https://undeadly.org/cgi?action=arti...20200528091634

Quote:
How do I format my 16GB USB Key using FFS2 without journaling...
As I noted above, there is no journaling, so there is no journaling knob in newfs(8). If you want FFS2 at OpenBSD 6.7, you must use the -O2 option with newfs(8). In -current, -O2 is the default. Either way, # newfs -O2 sd<number><letter> will work.
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
Hot to format SD card as fat32 ? bsd007 OpenBSD General 6 29th October 2017 08:01 AM
New Package Format shep OpenBSD Packages and Ports 1 22nd September 2014 03:42 PM
How to convert MD5 hash into shadow format? guitarscn General software and network 2 29th November 2010 12:54 PM
create a FAT32 partition and format it. wesley OpenBSD General 2 6th November 2010 08:31 AM
strange with dvd+rw-format cyberboy FreeBSD General 0 26th May 2008 05:43 PM


All times are GMT. The time now is 02:49 PM.


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