LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 01-10-2019, 02:47 PM   #1
jhumphrey
Member
 
Registered: Jan 2019
Location: United States
Distribution: CentOS, OpenBSD
Posts: 60

Rep: Reputation: Disabled
Difficulty Mounting ext3 partition in OpenBSD 6.4


Hi All,

I am currently dual-booting (soon to be triple booting) a laptop between Linux and OpenBSD.

I have Linux installed on an ext3 partition, and I want to access this partition in OpenBSD.

So I first ran
Code:
fdisk sd0c
which output something like the following:
Code:
# ID ...
0 83 ...  (Linux)
1 83 ...  (Unused)
2 A6 ...  (OpenBSD)
3 82 ...  (swap for Linux)
So I try to mount the first partition (Here's where I think the problem is)
Code:
# mkdir /mnt/sda1
# mount -t ext2 /dev/sd0a /mnt/sda1
Device Busy
So I look in /etc/fstab

there are three entries, one for the swap, one for /, and one for /home

So I think that sd0a, sd0b, and sd0d are the OpenBSD partitions, while sd0c points to the entire disk.
does this make sense? if so, where do I find my Linux partition?

If this is a dumb question, where would be a good place for me to look in the man pages?

I tried fdisk(8), and mount(8), and the openBSD FAQ

Last edited by jhumphrey; 01-11-2019 at 09:56 AM.
 
Old 01-10-2019, 09:44 PM   #2
multios
Member
 
Registered: Mar 2006
Location: Homer, Alaska USA
Distribution: OpenBSD, FreeBSD, Slackware64-current
Posts: 276

Rep: Reputation: 58
First off, welcome to linuxquestions

If I read correctly what you wrote, you are trying to mount the / partition
To see which partition OpenBSD has labeled for linux, run as root: disklabel -p sd0 or perhaps /dev/sd0...if that's the harddrive you are using.
That will show you which partition to try and mount. So then you might, as an example write as root mount -t ext2fs /dev/sd0h /mnt.
Also, it may also have to be mounted read only, so then you type mount -r -t ext2fs /dev/sd0h /mnt

I can't run OpenBSD on this particular laptop, which makes my blood boil, so I'm going by memory.

HTH

Last edited by multios; 01-10-2019 at 09:46 PM. Reason: add welcome comment
 
1 members found this post helpful.
Old 01-11-2019, 07:17 AM   #3
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Quote:
Originally Posted by jhumphrey View Post
So I first ran
Code:
fdisk sd0c
which output something like the following:
Code:
# ID ...
0 83 ...  (Linux)
1 83 ...  (Unused)
2 A6 ...  (OpenBSD)
3 82 ...  (swap for Linux)
So I try to mount the first partition (Here's where I think the problem is)
Code:
# mkdir /mnt/sda1
# mount -t ext2 /dev/wd0a /mnt/sda1
You're also examining the MBR of sd0 with fdisk but then trying to mount a partition of wd0.
 
Old 01-11-2019, 09:30 AM   #4
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 289

Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by cynwulf View Post
You're also examining the MBR of sd0 with fdisk but then trying to mount a partition of wd0.
This. wd0 and sd0 are two different drives.
 
Old 01-11-2019, 09:58 AM   #5
jhumphrey
Member
 
Registered: Jan 2019
Location: United States
Distribution: CentOS, OpenBSD
Posts: 60

Original Poster
Rep: Reputation: Disabled
oops...
I am writing this on the Linux side, so I mounted sd0a NOT wd0a... typo.
I will try out your advice, and write back.
 
Old 01-11-2019, 11:32 AM   #6
jhumphrey
Member
 
Registered: Jan 2019
Location: United States
Distribution: CentOS, OpenBSD
Posts: 60

Original Poster
Rep: Reputation: Disabled
I was not clear enough in my first post, sorry.
So I am trying to mount my Linux partition from inside OpenBSD, and cannot find it.
I did a little research online and found that in FreeBSD I would look for something like ad0s1.
I could not find it, or sd0s1, so maybe OpenBSD uses a different system.
I guess it's time to dig into the FAQ again...

@multios, I tried running disklabel, It just gives me the OpenBSD partitions.
BTW are you sure it's disklabel -p?
 
Old 01-11-2019, 02:29 PM   #7
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 289

Rep: Reputation: 169Reputation: 169
Let's start with some level-setting. Let us assume, for right now, that you only have one physical disk drive, and you are using an architecture such as amd64 or i386 that boots with either MBR or GPT partitioning.
  • On OpenBSD, this drive would be either "wd0" or "sd0". wd(4) is the driver for IDE/PATA drives, while sd(4) is the driver for SCSI/SATA/USB drives. Disklabel partitions begin with "a" and end with "p", such as sd0h or wd1a.
  • There are two levels of disk partitioning. 1) MBR/GPT partitions, and 2) OpenBSD disklabel partitions. The single OpenBSD MBR/GPT partition is subdivided into multiple disklabel partitions.
  • When OpenBSD is first connected to a disk drive, and there is no on-disk OpenBSD disklabel already present -- OpenBSD will scan the MBR/GPT partition table and look for any pre-existing, recognized "foreign" MBR/GPT filesystem. It will build a virtual disklabel, pre-populated with any of these recognized filesystems, starting with disklabel partition letter "i". If there is already an OpenBSD disklabel on-disk, it will not scan the MBR or GPT partition table, and will only use what it finds on the on-disk disklabel. Therefore, if you have pre-existing MBR/GPT partitions, OpenBSD will find them when first installed. If you created these MBR/GPT partitions AFTER OpenBSD has written its disklabel, you must add these partitions to the disklabel manually.

Last edited by jggimi; 01-11-2019 at 02:34 PM. Reason: typos
 
3 members found this post helpful.
Old 01-14-2019, 09:22 AM   #8
jhumphrey
Member
 
Registered: Jan 2019
Location: United States
Distribution: CentOS, OpenBSD
Posts: 60

Original Poster
Rep: Reputation: Disabled
Thanks, @jggimi.
This helps clear up a lot of confusion.
I installed Linux before installing BSD, and because I formatted its partition as an ext3 instead of an ext2 it was not recognized, and thus not added to the disklabel.
Am I correct?
 
Old 01-14-2019, 10:53 AM   #9
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 289

Rep: Reputation: 169Reputation: 169
No, that's not the reason. EXT3 is EXT2 plus journaling. OpenBSD ignores journaling and treats the filesystem as EXT2. The apparent reason for failure to mount appears to be improper nomenclature in your mount command.

You have stated that the Linux partition was first-on-disk before OpenBSD was installed. If that is true, then there should be an "i" disklabel partition created when OpenBSD did not find a pre-existing disklabel, and scanned the MBR or GPT.

Your mount command should be one of these two commands, depending on whether the drive is EDI/PATA or SCSI/SATA/USB.
Code:
# mount -t ext2 /dev/wd0i /mnt
or
Code:
# mount -t ext2 /dev/sd0i /mnt
I have intentionally NOT added your directory "sda1" as a mount point because you are already confused about OpenBSD disk drive nomenclature, and I recommend you not use Linux nomenclature which does not apply on OpenBSD systems.
 
1 members found this post helpful.
Old 01-17-2019, 10:17 AM   #10
jhumphrey
Member
 
Registered: Jan 2019
Location: United States
Distribution: CentOS, OpenBSD
Posts: 60

Original Poster
Rep: Reputation: Disabled
I solved the problem, with all of your help.
My Linux partition was not in the disklabel, so I edited the disklabel, and I can mount now.
Thank you for all your help.

P.S. I changed the name of the mount point from sda1 to Linux.
P.P.S OpenBSD has great documentation, better than Linux IMHO.
 
Old 01-17-2019, 12:54 PM   #11
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 289

Rep: Reputation: 169Reputation: 169
Glad you got the problem resolved!
Quote:
Originally Posted by jhumphrey View Post
My Linux partition was not in the disklabel...
As noted earlier, that will happen when an OpenBSD disklabel is stored on disk before the Linux partition is installed.

There are two OTHER ways this might have occured: either a custom partitioning schema was deployed during installation, or, more likely, OpenBSD was re-installed and the partition not retained during re-installation.

Last edited by jggimi; 01-17-2019 at 12:57 PM. Reason: clarity, and a thinko
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
difficulty mounting ???unknown (I thought EXT3) to access recorded video files blueinca99 Linux - Newbie 5 06-30-2014 12:19 AM
LXer: OpenBSD: The OpenBSD Foundation LXer Syndicated Linux News 0 07-26-2007 10:31 AM
OpenBSD - Where can i get OpenBSD 3.7 ISO CD -- Please help me b:z Linux - Software 5 04-08-2005 07:09 AM
OpenBSD - Where can i get OpenBSD 3.7 ISO CD -- Please help me b:z Linux - Software 1 04-07-2005 08:46 AM
how to convert ext3 to ntfs? cannot even see ext3 partition parv Linux - Hardware 1 12-31-2004 02:56 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration