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 19th June 2019
joancatala joancatala is offline
Port Guard
 
Join Date: Jun 2011
Posts: 34
Default How can I mount a UFS hard disk from OpenBSD?

Hi all,

I have a dock with a 4TB hardisk connected on the USB port on my laptop. The hardisk works perfectly on FreeBSD because the format is UFS.

How can I mount this harddisk on OpenBSD?

I tried "mount /dev/sd1i /mnt" but
Code:
lenovo# mount /dev/sd1i /mnt/disc1/ 
mount_ffs: /dev/sd1i on /mnt/disc1: Invalid argument
lenovo#
I tried disklabel to see the situation:
Code:
lenovo# disklabel sd1               
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: EZRZ-00GXCB0    
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 486401
total sectors: 7814037168
boundstart: 0
boundend: 7814037168
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  c:       7814037168                0  unused                    
  i:            32734               34 unknown                    
  j:       7814000640            32768   MSDOS                    
lenovo#
Can somebody give me some tricks?
Reply With Quote
  #2   (View Single Post)  
Old 19th June 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default

There are 2 things I see here, maybe try:
Code:
# mount /dev/sd1j
But also did you make a dir in /mnt named "disc1" if not then you need to make the dir first.
__________________
My best friends are parrots
Reply With Quote
  #3   (View Single Post)  
Old 20th June 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

As Garry noted, it appears there's a FAT partition in the MBR partition table.

If you meant "UDF", OpenBSD can natively support UDF read-only. Read/Write is possible using the udfclient package.

Last edited by jggimi; 20th June 2019 at 11:07 AM. Reason: clarity
Reply With Quote
  #4   (View Single Post)  
Old 20th June 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default

Quote:
Can somebody give me some tricks?
Instead of using /mnt, I make a directory, as normal user :
Code:
$ pwd
$ /home/garry/
$ mkdir usb
$
Then mount the drive to /home/garry/usb/
Code:
$ su
$ password ---
#  pwd
# /home/garry
# mount /dev/sd1j usb
# exit
$ cd usb
$ ls 
(to see what I have )
This way I can read,write,etc as a normal user instead needing to be root,..also many reccomend using "doas", to do this, but that probably would be a entire different topic.
__________________
My best friends are parrots
Reply With Quote
  #5   (View Single Post)  
Old 20th June 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Ah, I missed the second sentence:
Quote:
Originally Posted by joancatala View Post
The hardisk works perfectly on FreeBSD because the format is UFS.
OpenBSD and FreeBSD disklabels have the same BSD roots, but they are not compatible. You would have to manually create on on-disk OpenBSD disklabel, add the partition manually, and then attempt to mount it. It is not clear to me that you would be able to mount it, since both OpenBSD and FreeBSD created different FFS/UFS extensions to manage partitions larger than 2TB.
Reply With Quote
  #6   (View Single Post)  
Old 20th June 2019
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 437
Default

As jggimi says the FreeBSD and OpenBSD UFS implementation are not compatible.

I convert my desktop workstation to OpenBSD after 20 years of using FreeBSD so I had to figure out what to do with large data drives. Best I could come up with so far is to maintain a FreeBSD server and mount these drives via NFS from my OpenBSD machine.
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
  #7   (View Single Post)  
Old 20th June 2019
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,131
Default

FreeBSD calls the traditional 4 MBR partitions "slices". In FreeBSD each MBR partition or slice has a
private disklabel, while in OpenBSD there is only one disklabel for the whole disk, i.e. all 4 MBR partitions. This means that with the unmodified OpenBSD disklabel, you only will be able to mount the FreeBSD "a" or root partition/filesystem.

I can mount a FreeBSD partition from OpenBSD:
Code:
obsd# disklabel wd0

  # /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: WDC WD3200AAKS-0
duid: e9298df9f130b613
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 38913
total sectors: 625142448
boundstart: 20971944
boundend: 104857704
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize   cpg]
  a:          4194296         20971944  4.2BSD   2048 16384 12958 # /
  b:           524288         25166240    swap                    # none
  c:        625142448                0  unused                    
  d:          6291456         25690528  4.2BSD   2048 16384 12958 # /usr
  e:          4194304         31981984  4.2BSD   2048 16384 12958 # /home
  i:         20971440              504 unknown                    
  j:        520284744        104857704 unknown
Both the "i" and "j" partition are separate FreeBSD installs.
To mount it:
Code:
obsd# mount -o ro /dev/wd0i /mnt
obsd# ls -l /mnt

total 65776
-rw-r--r--   2 root  wheel          951 Dec  7  2018 .cshrc
-rw-r--r--   2 root  wheel          470 Dec  7  2018 .profile
drwxrwxr-x   2 root  operator       512 May 19 08:05 .snap
-r--------   1 root  wheel     33554432 May 19 08:05 .sujournal
-r--r--r--   1 root  wheel         6177 Dec  7  2018 COPYRIGHT
drwxr-xr-x   2 root  wheel         1024 May 20 20:44 bin
drwxr-xr-x  10 root  wheel         1536 Jun 20 17:24 boot
drwxr-xr-x   2 root  wheel          512 May 19 08:05 dev
-rw-------   1 root  wheel         4096 Jun 20 17:24 entropy
drwxr-xr-x  25 root  wheel         2560 Jun 12 02:19 etc
lrwxr-xr-x   1 root  wheel            8 May 19 08:11 home -> usr/home
drwxr-xr-x   4 root  wheel         1536 May 20 20:44 lib
drwxr-xr-x   3 root  wheel          512 Dec  7  2018 libexec
drwxr-xr-x   2 root  wheel          512 Dec  7  2018 media
drwxr-xr-x   2 root  wheel          512 Dec  7  2018 mnt
drwxr-xr-x   2 root  wheel          512 Dec  7  2018 net
dr-xr-xr-x   2 root  wheel          512 Dec  7  2018 proc
drwxr-xr-x   2 root  wheel         2560 Dec  7  2018 rescue
drwxr-xr-x   2 root  wheel          512 Jun 12 02:19 root
drwxr-xr-x   2 root  wheel         2560 Dec  7  2018 sbin
lrwxr-xr-x   1 root  wheel           11 Dec  7  2018 sys -> usr/src/sys
drwxrwxrwt  19 root  wheel         1024 Jun 20 17:24 tmp
drwxr-xr-x  15 root  wheel          512 May 19 08:11 usr
drwxr-xr-x  25 root  wheel          512 Jun 20 16:26 var
I also can mount the FreeBSD "a" filesystem of the other "j" partition without a problem.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 22nd June 2019
Funkygoby Funkygoby is offline
Fdisk Soldier
 
Join Date: Aug 2015
Posts: 57
Default

Quote:
Originally Posted by GarryR View Post
Instead of using /mnt, I make a directory, as normal user :
Exact same workflow for me.
I also added 2 doas rules that allow my user to use mount/umount for simple case, covers 99% of usage:
Code:
permit nopass funkygoby as root cmd mount args /dev/sd1i mnt/
permit nopass funkygoby as root cmd umount args mnt/
For anything more complicated (several devices, multiple partitions) I fallback to the root account but still use directory create by user for the R/W permissions
Reply With Quote
Reply


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
How to porting Openbsd 2.7 to support 128GB hard disk? terrance OpenBSD General 3 22nd March 2012 03:11 AM
Unable to mount second hard drive Roric OpenBSD General 3 15th February 2011 05:02 AM
Hard disk reliability ephemera General Hardware 32 20th April 2010 10:17 AM
Hard disk utilization Greg_Morgan General software and network 3 16th October 2009 12:13 PM
how to mount external hard disk ? bsdnewbie999 FreeBSD General 6 27th May 2008 02:37 AM


All times are GMT. The time now is 03:30 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