DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th July 2024
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,179
Default Mounting OpenBSD 7.? partition under MX Linux 23.3

Some years ago I figured out to mount OpenBSD partitions using Linux. I lost the note, and a few hours ago I had to go through that process again ....

My first syntax or wrong formed mount commands gave the hint that dmesg could give a hint of what I did wrong.
Code:
ufs: You didn't specify the type of your ufs filesystem
     mount -t ufs -o ufstype=sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...]
Well I did specify that, but using the wrong syntax. The correct command to mount what I hoped to be the /var partition:
Code:
$ mount sudo mount -r -t ufs -o ufstype=ufs2 /dev/sda14 /mnt
$ mount
[snip]
/dev/sda14 on /mnt type ufs (ro,relatime,ufstype=ufs2,onerror=lock)
Some remarks:
  • I used $ sudo dmesg | less to find the hard disk designation
    Code:
    [    3.189646] sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
    sd 0:0:0:0: [sda] 4096-byte physical blocks
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
    sd 0:0:0:0: [sda] Preferred minimum I/O size 4096 bytes
    sda: sda4
               sda4: <openbsd: sda5 sda6 sda7 sda8 sda9 sda10 sda11 sda12 sda13 sda14 >
  • The OpenBSD disklabelled partitions are sda5 up to sda14.
    This was not the /var that I hoped for, but my OpenBSD /home. But I could copy now a few files from my old home directory.
  • To find the mapping of the OpenBSD partition to the Linux sda5 - sda14 designations, I had to consult the OpenBSD /etc/fstab on the Linux sda5:
    Code:
    $ sudo mount -r -t ufs -o ufstype=ufs2 /dev/sda5 M
    [sudo] password for adriaan:          
    adriaan@mx23:~
    $ cd M
    adriaan@mx23:~/M
    $ ls -l
    total 71958
    drwxr-xr-x  2 root root      512 Apr 12  2022 altroot
    drwxr-xr-x  2 root root     1024 May  3  2023 bin
    -rw-r--r--  1 root root    90496 Jul 31  2022 boot
    -rwx------  1 root root 22984981 Jul 15 06:41 bsd
    -rwx------  1 root root 22981557 Feb 29 02:40 bsd.booted
    -rw-------  1 root root  4606368 Jun 24  2022 bsd.rd
    -rw-------  1 root root 22876084 Jun 24  2022 bsd.sp
    drwxr-xr-x  6 root root    19456 Jul 15 06:40 dev
    drwxr-xr-x 36 root root     2048 Jul 15 08:28 etc
    drwxr-xr-x  2 root root      512 Jun 24  2022 home
    -rw-r--r--  1 root root       45 Sep  8  2022 iface_KEYPUB
    drwxr-xr-x  2 root root      512 Apr 12  2022 mnt
    drwx------  6 root root      512 Dec 25  2022 root
    drwxr-xr-x  2 root root     1536 May  3  2023 sbin
    lrwxrwx---  1 root root       11 Apr 12  2022 sys -> usr/src/sys
    drwxr-xr-x  2 root root      512 Jun 24  2022 tmp
    -rw-r--r--  1 root root      112 Jun 26  2022 tmpVesa_driver.conf
    drwxr-xr-x  2 root root      512 Jun 24  2022 usr
    drwxr-xr-x  2 root root      512 Jun 24  2022 var
    adriaan@mx23:~/M
    For mounting inside my Linux home, I created the directory M earlier on.
  • Code:
     $ cat etc/fstab
    3523714d1d19eb6c.b none swap sw
    3523714d1d19eb6c.a / ffs rw 1 1
    3523714d1d19eb6c.k /home ffs rw,nodev,nosuid 1 2
    3523714d1d19eb6c.d /tmp ffs rw,nodev,nosuid 1 2
    3523714d1d19eb6c.f /usr ffs rw,nodev 1 2
    3523714d1d19eb6c.g /usr/X11R6 ffs rw,nodev 1 2
    3523714d1d19eb6c.h /usr/local ffs rw,wxallowed,nodev 1 2
    3523714d1d19eb6c.j /usr/obj ffs rw,nodev,nosuid 1 2
    3523714d1d19eb6c.i /usr/src ffs rw,nodev,nosuid 1 2
    3523714d1d19eb6c.e /var ffs rw,nodev,nosuid 1 2
    The entries are sorted according to the partition names (/, home, tmp,usr*, var)
  • Sorting these on the first fstab field with the disklabels:
    Code:
    adriaan@mx23:~/M
    $ sort etc/fstab | cat -n
         1	3523714d1d19eb6c.a / ffs rw 1 1
         2	3523714d1d19eb6c.b none swap sw
         3	3523714d1d19eb6c.d /tmp ffs rw,nodev,nosuid 1 2
         4	3523714d1d19eb6c.e /var ffs rw,nodev,nosuid 1 2
         5	3523714d1d19eb6c.f /usr ffs rw,nodev 1 2
         6	3523714d1d19eb6c.g /usr/X11R6 ffs rw,nodev 1 2
         7	3523714d1d19eb6c.h /usr/local ffs rw,wxallowed,nodev 1 2
         8	3523714d1d19eb6c.i /usr/src ffs rw,nodev,nosuid 1 2
         9	3523714d1d19eb6c.j /usr/obj ffs rw,nodev,nosuid 1 2
        10	3523714d1d19eb6c.k /home ffs rw,nodev,nosuid 1 2
    With a difference of 4 between the line numbers and the Linux partitions numbering, it looks like mounting sda8 is the /var partition I was looking for.
  • Code:
    $ mkdir V
    mkdir: cannot create directory ‘V’: Read-only file system
    adriaan@mx23:~/M
    $ mkdir ~/V
    adriaan@mx23:~/M
    $ cd ~
    adriaan@mx23:~
    $ sudo mount -r -t ufs -o ufstype=ufs2 /dev/sda8 V
    [sudo] password for adriaan:          
    adriaan@mx23:~
    $ ls -l V
    total 48
    drwxr-xr-x  2 root root    512 Apr 12  2022 account
    drwxrws---  2 root root    512 Apr 12  2022 audit
    drwxrwx---  2 root     72  512 Apr 12  2022 authpf
    drwx------  2 root root   4096 Jun 17  2023 backups
    drwxr-xr-x  4 root root    512 Apr 12  2022 cache
    drwxrwx---  2 root root    512 Jun 24  2022 crash
    dr-xr-xr-x  4 root root    512 Apr 13  2023 cron
    drwxr-xr-x 10 root root    512 May  6  2023 db
    drwxr-xr-x  2 root root    512 Apr 12  2022 empty
    drwxrwxr-x  4 root proxy   512 Jun 24  2022 games
    drwxr-xr-x  3 root root   1536 Jul 15 08:28 log
    drwx-----T  2 root root   2048 Sep 30  2022 lost+found
    drwxr-xr-x  2 root root    512 Jun  1  2023 mail
    drwxr-xr-x  6 root root    512 Apr 12  2022 nsd
    drwxr-x---  2 root tty     512 Apr 12  2022 quotas
    drwxr-xr-x  4 root root    512 Jul 15 08:28 run
    drwxr-xr-x  2 root root    512 Sep 30  2022 sasl2
    drwxr-xr-x  6 root root    512 Apr 12  2022 spool
    drwx------  2 root root    512 Jun 24  2022 sysmerge
    drwxr-xr-x 30 root root   1024 May  3  2023 syspatch
    lrwxrwx---  1 root root      6 Apr 12  2022 tmp -> ../tmp
    drwxr-xr-x  4 root root    512 Apr 12  2022 unbound
    drwxr-xr-x 11 root daemon  512 Aug 21  2022 www
    drwxr-xr-x  2 root root    512 Apr 12  2022 yp
    And yes it did. Now I can try to copy the Xorg modlines from the OBSD Xorg.0.log to Linux ......
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 18th July 2024 at 05:16 AM.
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
I am having trouble mounting a partition on a bootable USB drive. Omphalotus_japonicus OpenBSD General 1 31st January 2021 10:54 PM
problem with mounting windows partition Ondrej NetBSD General 4 2nd December 2016 03:26 PM
FreeBSD won't boot after mounting root partition on OpenBSD Jtf FreeBSD Installation and Upgrading 12 19th March 2014 04:43 AM
Mounting a NetBSD partition from OpenBSD daemonfowl OpenBSD General 4 19th July 2012 12:03 PM
Mounting a FreeBSD UFS partition roddierod Solaris 1 7th August 2008 02:02 PM


All times are GMT. The time now is 01:35 AM.


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