Need help with the correct SLICE ID reddit / freebsd ---------------------------------------------------------------------- Nick-6 · 2021-09-22 16:09 I'm trying to mount an `ext4` disk (marked with <==). I've followed the handbook but failed to get the correct slice id (partition id?). # gpart show => 34 234441581 ada0 GPT (112G) 34 2014 - free - (1.0M) 2048 1048576 1 efi (512M) 1050624 72316928 6 freebsd-zfs (34G) 73367552 5244928 2 freebsd-swap (2.5G) 78612480 78125056 3 linux-data (37G) 156737536 58593280 4 linux-data (28G) 215330816 19109888 5 linux-swap (9.1G) 234440704 911 - free - (456K) => 63 625142385 da0 MBR (298G) 63 1 - free - (512B) 64 62914560 2 freebsd [active] (30G) 62914624 4030 - free - (2.0M) 62918654 513800194 1 ebr (245G) 576718848 48423600 - free - (23G) => 0 513800194 da0s1 EBR (245G) 0 513800194 1 linux-data (245G) <============ This one => 0 62914560 da0s2 BSD (30G) 0 46137344 1 freebsd-ufs (22G) 46137344 16777216 2 freebsd-swap (8.0G) # mount -t ext2fs /dev/da0s1 /media/hdd-data mount: /dev/da0s1: Invalid argument The command works well with `/dev/ada0p3` which is Debian's `/home` partition. I'm dual booting FreeBSD with Debian. # mount -t ext2fs /dev/ada0p3 /media/debian-home ---------------------------------------------------------------------- meatmechdriver · 2021-09-22 17:10 I don't think you've identified the wrong slice, I think there might be something about this particular ext4fs that isn't supported by the freebsd ext2fs driver. From the manpage: DESCRIPTION The ext2fs driver will permit the FreeBSD kernel to access ext2 file systems and its derivatives. It currently implements most of the features required by ext3 and ext4 file systems. Support for Extended Attributes in ext4 is experimental. Journalling and encryption are currently not supported. Have you tried fusefs-ext2? ---------------------------------------------------------------------- Nick-6 · 2021-09-22 17:23 I forgot mention that I'm using FreeBSD-13. That DESCRIPTION is for prior versions. Please check [21.2. Linux® File Systems](https://docs.freebsd.org/en/books/handbook/filesystems/) and [ext2fs(5)](https://www.freebsd.org/cgi/man.cgi?query=ext2fs&sektion=5 &format=html) . >This driver can also be used to access ext3 and ext4 file systems. The ext2fs(5) filesystem has full read and write support for ext4 as of FreeBSD 12.0-RELEASE. Additionally, extended attributes and ACLs are also supported, while journalling and encryption are not. Starting with FreeBSD 12.1-RELEASE, a DTrace provider will be available as well. Prior versions of FreeBSD can access ext4 in read and write mode using sysutils/fusefs-ext2. ---------------------------------------------------------------------- meatmechdriver · 2021-09-22 17:44 No, that DESCRIPTION is verbatim from ext2fs(5) on FreeBSD 13.0-RELEASE, and that manpage hasn't changed in -stable or -current. Try fusefs-ext2 and see if you get similar results. ---------------------------------------------------------------------- Nick-6 · 2021-09-22 17:57 Sorry, I found that man page. I'm on RELEASE too. Here is the result with `fuse-ext2` . # mount -t fuse-ext2 /dev/da0s1 /media/hdd-data mount: /dev/da0s1: Operation not supported by device # fuse-ext2 /dev/da0s1 /media/hdd-data # <=== Nothing returns ---------------------------------------------------------------------- meatmechdriver · 2021-09-22 18:09 Ok, the plot thickens... it's been a long while since I worked with MBR disks, what's listed in /dev/da0\* ? Edit: I'm thinking you need to mount da0s1p1, which is why I ask. Edit: I'm forgetting my slice semantics, that would be da0s1a ---------------------------------------------------------------------- Nick-6 · 2021-09-22 18:12 > \# ls /dev/da0\* /dev/da0 /dev/da0s1 /dev/da0s1+00000001 /dev/da0s2 /dev/da0s2a /dev/da0s2b /dev/da0s5 ---------------------------------------------------------------------- meatmechdriver · 2021-09-22 18:22 To be more verbose, partitions and labels are a spot of confusion for me, but I think what we have here is a MBR disk with an EBR that has some label on it, making it a partitioned slice. Since the partition is the GEOM consumer of the slice, I *think* you can't mount the slice directly even though the filesystem in the label spans the entire slice. Someone more competant may want to correct me here. ---------------------------------------------------------------------- meatmechdriver · 2021-09-22 18:37 That's weird: `/dev/da0s1+00000001` What's the output of `geom -p da0s1+000000001`? ---------------------------------------------------------------------- nawcom · 2021-09-23 01:58 ada0s1 is the EFI system partition since it's using the GUID Partition Table (gpt). It's fat32. That's why you get the error. The only linux data partition on that disk other than s3 is s4. ---------------------------------------------------------------------- Nick-6 · 2021-09-23 03:25 Yes, I can mount `/dev/ada0p3` . The problem is with the external hard disk `/dev/da0` . ---------------------------------------------------------------------- Nick-6 · 2021-09-23 03:28 % geom -p /dev/da0s1+00000001 geom: Cannot find provider '/dev/da0s1+00000001'. ---------------------------------------------------------------------- meatmechdriver · 2021-09-23 04:37 Yeah that is super strange, it should be da0s1a. What sort of label is on that EBR partition? Is it a bsd label? ---------------------------------------------------------------------- meatmechdriver · 2021-09-23 04:39 Also, let’s see the da0 portion of geom -t, I am curious about the geom provider/consumer view ---------------------------------------------------------------------- meatmechdriver · 2021-09-23 04:42 GPT partition GEOM providers use p, not s, e.g. ada0p1. ---------------------------------------------------------------------- Nick-6 · 2021-09-23 05:41 This is `da0` part of `geom -t` output. ```da0 DISK da0 da0 PART da0s1 da0s1 PART da0s1+00000001 da0s1+00000001 LABEL ext2fs/Data ext2fs/Data DEV da0s1+00000001 DEV da0s1 DEV da0 PART da0s2 da0s2 PART da0s2a da0s2a LABEL ufsid/5fabf90c525aab6c ufsid/5fabf90c525aab6c DEV da0s2a DEV da0s2 PART da0s2b da0s2b DEV da0s2 DEV da0 DEV``` ---------------------------------------------------------------------- Nick-6 · 2021-09-23 05:44 I'm not sure which one. So, I have to put a long text. This is `da0` part of `gpart list`. ```Geom name: da0 modified: false state: OK fwheads: 255 fwsectors: 63 last: 625142447 first: 63 entries: 4 scheme: MBR Providers: 1. Name: da0s1 Mediasize: 263065699328 (245G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 32214350848 Mode: r0w0e0 efimedia: HD(1,MBR,0x8b5dea22,0x3c00ffe,0x1e9ff802) rawtype: 5 length: 263065699328 offset: 32214350848 type: ebr index: 1 end: 576718847 start: 62918654 2. Name: da0s2 Mediasize: 32212254720 (30G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 32768 Mode: r0w0e0 efimedia: HD(2,MBR,0x8b5dea22,0x40,0x3c00000) attrib: active rawtype: 165 length: 32212254720 offset: 32768 type: freebsd index: 2 end: 62914623 start: 64 Consumers: 1. Name: da0 Mediasize: 320072933376 (298G) Sectorsize: 512 Mode: r0w0e0 Geom name: da0s1 modified: false state: OK fwheads: 255 fwsectors: 63 last: 513800193 first: 0 entries: 8155558 scheme: EBR Providers: 1. Name: da0s1+00000001 Mediasize: 263065698304 (245G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 32214351872 Mode: r0w0e0 rawtype: 131 length: 263065698304 offset: 1024 type: linux-data index: 1 end: 513800193 start: 0 Consumers: 1. Name: da0s1 Mediasize: 263065699328 (245G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 32214350848 Mode: r0w0e0 Geom name: da0s2 modified: false state: OK fwheads: 255 fwsectors: 63 last: 62914559 first: 0 entries: 8 scheme: BSD Providers: 1. Name: da0s2a Mediasize: 23622320128 (22G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 32768 Mode: r0w0e0 rawtype: 7 length: 23622320128 offset: 0 type: freebsd-ufs index: 1 end: 46137343 start: 0 2. Name: da0s2b Mediasize: 8589934592 (8.0G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 23622352896 Mode: r0w0e0 rawtype: 1 length: 8589934592 offset: 23622320128 type: freebsd-swap index: 2 end: 62914559 start: 46137344 Consumers: 1. Name: da0s2 Mediasize: 32212254720 (30G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 32768 Mode: r0w0e0 ``` ---------------------------------------------------------------------- eneet · 2021-09-23 07:19 It seems that FreeBSD names the logical partition using a '+' character followed by a logical paritition id. Probably /dev/da0s5 is the symlink for /dev/da0s1+00000001. The disk device you want to mount seems /dev/da0s5 or /dev/da0s1+00000001. ---------------------------------------------------------------------- Nick-6 · 2021-09-23 07:34 It returns operation not permitted as follows; ``` # mount -t ext2fs /dev/da0s5 /media/debian-home mount: /dev/da0s5: Operation not permitted # mount -t ext2fs /dev/da0s1+00000001 /media/debian-home mount: /dev/da0s1+00000001: Operation not permitted ``` ---------------------------------------------------------------------- eneet · 2021-09-23 07:41 Can you mount the partition as a read-only filesystem? mount -o ro -t ext2fs /dev/da0s5 /media/debian-home ---------------------------------------------------------------------- Nick-6 · 2021-09-23 07:50 Wow. It works. Can you please explain why it is `da0s5` (I mean how can I know that) and why only read-only works? And is there anyway I can mount it with write access? How can I fix that? ---------------------------------------------------------------------- eneet · 2021-09-23 08:00 > Can you please explain why it is da0s5 (I mean how can I know that) I guess the logical parition id starts from 5 to keep compatibility with DOS (and Windows?) parition numbering. > why only read-only works? I don't know. But probably you can find the reason from /var/log/mesages or the console outputs. The kernel outputs the log message when read-write mount fails. > And is there anyway I can mount it with write access? How can I fix that? Again, you can get the reason why the kernel has refused to mount it read-write mode from /var/log/messages or the console output. The fix depends on the reason. ---------------------------------------------------------------------- meatmechdriver · 2021-09-23 16:30 I'm still very irked that the provider name is da0s1+00000001. Can you reboot or reattach the disk and see if that sticks? Also, when you tried to mount that device, are you sure your shell globbing didn't mess with it? It didn't look like you escaped the + or put the string in single quotes to exclude it from expansion by the shell. ---------------------------------------------------------------------- Nick-6 · 2021-09-23 16:45 Yes, I've tried rebooting, re-attaching and it still persists. I don't understand *shell globbing* part (sorry, I'm a newbie). But, I have another disk with NTFS format and when I mount that disk, I get the following messages in `/var/log/messages` (thanks to u/eneet ). I think you might get some clues with it. ```Sep 23 23:04:46 FreeBSD ntfs-3g[33590]: Version 2017.3.23 external FUSE 29 Sep 23 23:04:46 FreeBSD ntfs-3g[33590]: Requested device /dev/da1s5 canonicalized as /dev/da1s1+00000001 Sep 23 23:04:46 FreeBSD ntfs-3g[33590]: Mounted /dev/da0s1+00000001 (Read-Write, label "Nick", NTFS 3.1) Sep 23 23:04:46 FreeBSD ntfs-3g[33590]: Cmdline options: Sep 23 23:04:46 FreeBSD ntfs-3g[33590]: Mount options: allow_other,nonempty,relatime,fsname=/dev/da0s1+00000001 Sep 23 23:04:46 FreeBSD ntfs-3g[33590]: Ownership and permissions disabled, configuration type 1``` ---------------------------------------------------------------------- backtickbot · 2021-09-23 16:45 [Fixed formatting.](https://np.reddit.com/r/backtickbot/comments/ptzav o/httpsnpredditcomrfreebsdcommentsptat0cneed_help/) Hello, Nick-6: code blocks using triple backticks (\`\`\`) don't work on all versions of Reddit! Some users see [this](https://stalas.alm.lt/backformat/hdze9c6.png) / [this](https://stalas.alm.lt/backformat/hdze9c6.html) instead. To fix this, **indent every line with 4 spaces** instead. [FAQ](https://www.reddit.com/r/backtickbot/wiki/index) ^(You can opt out by replying with backtickopt6 to this comment.) ---------------------------------------------------------------------- grahamperrin · 2021-09-25 09:49 > why only read-only works? Without seeing logs: my first guess would be that the file system is dirty (was not previously cleanly unmounted).