FreeBSD filesystem, FFS, UFS

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

FreeBSD filesystem, FFS, UFS

#1 Post by Jesse »

Hello,

Sage is asking for FreeBSD filesystem detection by guess_fstype.
I've discovered that is called FFS but it is mounted by the ufs Linux kernel module.

However there are apparently lots of different varieties of UFS... and you need to specify the variety on the mount command line as an option.

I can determine two aspects of the UFS from the superblock, namely if it is ufs/ufs2 format, and if it is 4.2 or 4.4 bsd inode format.
Presumably that means that we can determine ufs/old/ufs2/44bsd, but there are many more options than that!

http://wiki.netbsd.se/How_to_mount_FFS_ ... nder_Linux

mount -t ufs -o ufstype=sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...
>>>WARNING<<< Wrong ufstype may corrupt your filesystem, default is ufstype=old

ffs ufs filesystem identification:
http://fxr.watson.org/fxr/source/ufs/ffs/fs.h

So I am wondering if someone out there has some knowlege on how to definitively identify these filesystems from each other?

Also the default setup for the Linux Kernel ufs module is for read-only mode, so I'm not sure if its going to matter too much or not?

Jesse

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#2 Post by steve_s »

I know this is an old thread, but I want to get an answer to it, so maybe a post from me will wake it back up.

One of my distro's that I use is FreeBSD...no livecd that I know of will read it.

Jesse: did you get an answer to this? I would love to know, for the sake of security, how to access these drives via a livecd...does anyone know how to answer this question for Jesse, i.e. how to mount a FreeBSD drive and, in the process, perhaps this will answer my curiosity...

The reason I wanted to know is because of security, like I mentioned: I am wondering about encrypting drives and the best way to secure them against livecd reading, when I noticed that the FreeBSD drive doesn't get read by anything...I've seen a couple of mentions on how to read them using ufs, but I wasn't able to mount this drive via livecd, and I'm certain there is something I'm missing...

From what I've seen on the Puppy Linux forum, if there is a way to do it, you guys have figured it out already but I can't find any other info on FreeBSD in the murga forum...

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#3 Post by steve_s »

Ok, as I'm prone to do, I hacked around and figured out my part of it...

To mount the FreeBSD drive, I did this first:

Code: Select all

modprobe ufs
...but I don't know if that was necessary or not as it looked like ufs was already available.

Then, to mount it, I was trying to mount the /dev/sdb4 drive to the location /mnt/sdb4.

The command that worked was this:

Code: Select all

mount -r -t ufs -o ufstype=ufs2 /dev/sdb4 /mnt/sdb4
...and that worked like a champ.

I got the information about using that mount command from here.

Oh, I should point out that I was using 4.2 that was modified somewhat, but basically standard 4.2 Puppy. In other words, it looks like Puppy does just fine being able to read these type of ufs drives.

8)

**EDIT**NOT SO FAST!! Well, I booted up the FreeBSD drive to see why I couldn't see all the files and sure enough that mount of the ufs in Puppy only gives me access to all but the files I want, namely /usr/home/(username) files. That is where FreeBSD keeps it's user files. In Puppy that just shows up as /usr/ then a bad link for "home." Hmmm...anyone know the answer to that one? At a loss...

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#4 Post by ttuuxxx »

you actually might have to compile something, here's a way of finding out, :)
open gparted up on puppy :) then click Gparted ---> Show features
that will tell you what you can and can't do with ufs, then all you do us finout what file will give you more options for ufs and compile it.
when I compiled the latest libparted/gparted/e2fsprogs for puppy 4.0 It almost doubled what I could view and change, it wasn't a full fix for ext4 like I was aiming for, but I did have a lot new file functions :)
here's the thread
http://www.murga-linux.com/puppy/viewtopic.php?t=41656
ttuuxxx
ps the e2fsprogs-1.41.5-i386.pet is mid way, page 1 :wink:
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#5 Post by steve_s »

ttuuxxx: right now I'm laughing at your last post on that thread...I can totally relate...oh, well.

Update: I read further on that link that I had provided. It mentions that the unix file system breaks it down even further and that you have to designate which one it is.

Like it mentions I ran:

Code: Select all

dmesg | grep bsd
and I came up with bsd sdb13 sdb14 and sdb15

I can mount 13 and 15 no effort using ufstype=ufs2,ro but no matter what I've tried I cannot mount sdb14 which, of course, is where the data is.

The error I keep getting is invalid filesystem type, or etc. and it gives me a bunch of possibilities, non of which give me a real indication as to why it will mount the others but not that one.

Oh, and gparted won't work on that drive anway: it's too convoluted with invaled extended partitions and what-not. So, I have to use something like fdisk -l but am open to other suggestions...

So does anyone know why that segment won't mount?

Again, this is more than anything to get a grasp of Puppy's ability to mount ufs drives than anything else...

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#6 Post by ttuuxxx »

I had a look around, I noticed at the ubuntu repo they had like 6 small packages, so I downloaded them and made a pet for you. its below. maybe try that. This is whats in the pet, plus the related deps. Almost sounds like a job for woof and its ubuntu repo.
http://packages.ubuntu.com/jaunty/ufsutils
also you can look at
http://packages.ubuntu.com/search?mode= ... ywords=UFS
a few of those packages are included in the pet.
also here's some info
http://www.freebsd.org/cgi/ports.cgi?qu ... &stype=all
well hope some of that helps
ttuuxxx
Attachments
ufsutils.pet
(185 KiB) Downloaded 796 times
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#7 Post by steve_s »

Thanks, ttuuxxx...that's very kind and courteous of you...very appreciated. I'm trying out those utils now to see if I can get the pet loaded...

Here is something new regarding ufs:
A relative was given a Safenet Sentenial usb dongle. No one knows what is on it or where it came from...it was given to me with the comment, if you can find something on there, take it off for us, but either way you can use it.

Can't read it or erase it, but I have been able to figure out its a unionfs. Any suggestions? Interesting stuff on dmesg...I'll post that if it will help.

...an actual mystery; I feel like the geeky version of James Bond. 8)

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#8 Post by steve_s »

Oh, come on, I've seen you guys/gals do amazing things with computers...has no one hacked one of those SafeNet usb things? We gotta solf the mystery! 8)

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#9 Post by Jesse »

steve_s wrote:Oh, come on, I've seen you guys/gals do amazing things with computers...has no one hacked one of those SafeNet usb things? We gotta solf the mystery! 8)
Perhaps you could use the command line tool 'dd' to copy any block data from the device to a file on your hard disk then examine it piece by piece...

Jesse

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#10 Post by steve_s »

Jesse wrote:
steve_s wrote:Oh, come on, I've seen you guys/gals do amazing things with computers...has no one hacked one of those SafeNet usb things? We gotta solf the mystery! 8)
Perhaps you could use the command line tool 'dd' to copy any block data from the device to a file on your hard disk then examine it piece by piece...

Jesse
Ok, good, but I don't know what it is mounted as or how to mount it...the only thing that only shows that it exists is partview; that's how I knew it was unionfs.

Is there something that I should be looking for in dmsg? Just start guessing mount points?

**Edit: posted screenshot of partview...notice how it points out the unionfs on there: that is the usb safenet device.
Attachments
partview.png
(6.67 KiB) Downloaded 1055 times

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#11 Post by steve_s »

Here, check out dmesg with this safenet sentinel thing...pretty strange stuff...line 264 on...is this related?

Code: Select all

usbcore: registered new interface driver usbled
usbcore: registered new interface driver usblcd
ieee80211_crypt: registered algorithm 'NULL'
ieee80211: 802.11 data/management/control stack, git-1.1.13
ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
usbcore: registered new interface driver usb8xxx
Intel(R) PRO/1000 Network Driver - version 7.3.20-k2
Copyright (c) 1999-2006 Intel Corporation.
usbcore: registered new interface driver ldusb
usbcore: registered new interface driver usbkbd
drivers/hid/usbhid/usbkbd.c: :USB HID Boot Protocol keyboard driver
How do I mount this thing? Any one have any ideas? I just want to read it if possible, then blank it out and use it as a flash drive...
Attachments
dmesg-safenet.zip
(4.71 KiB) Downloaded 404 times

User avatar
droope
Posts: 801
Joined: Fri 01 Aug 2008, 00:17
Location: Uruguay, Mercedes

#12 Post by droope »

In Puppy that just shows up as /usr/ then a bad link for "home."
Probably not, but perhaps /home/ is an absolute link to another folder, and that's why it isn't working?

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#13 Post by Jesse »

steve_s wrote:How do I mount this thing? Any one have any ideas? I just want to read it if possible, then blank it out and use it as a flash drive...
Hi steve_s,
If you want to know which lines in the dmesg output are from your usb dongle, reboot your computer without it inserted, then in a console window type 'tail -f /var/log/messages', then insert the dongle, the only lines you'll see are from what happens when linux sees the device appear.
If you want to poke around and mess with the device, try searching/examining under the /sys directory and look under the usb subsystem(s) to see what devices appear, and also you might check out /proc/bus/usb/* or /sys/bus/usb/devices/* to see what device nodes are in your system.
You'll need to do some cross referencing to figure out which device is which, eliminate the devices that you know about and see what is left over.
It might be that your dongle isn't a storage device, it might have some encryption function or something else like that which could be a bit odd and confusing, as it might look like a 1 block device that you can read and write, but always read some new garbage value instead of what you wrote, i.e. if its doing encryption.
Also I think you are confused about the unionfs icon being a representation of your safenet device, all most all puppy linux have a unionfs which merges several filesystems into the root filesystem, and technically you can't have a unionfs detected on a single device as it is not a format for a block device. See if that unionfs is there when you reboot without the device attached and then you'll know for sure, because if it is your device then its already mounted and you just need to figure out its mount point. :wink:
Jesse

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#14 Post by steve_s »

Yeah, Jesse, you are right on about much of that:
1. I don't think it is a block device, just an encryptor...
2. ..and you are right about the union fs being an error or something else, e.g. file system..

very well said...

...I am still going to mess with ttuxxx's utils on the installed freebsd that I got...thanks and I'll post back the effectiveness of being able to read FreeBSD...

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#15 Post by ttuuxxx »

Hi steve I would take jesse's advice over my advice on this topic any day, lol He knows his stuff when it comes to this sort of thing. I don't know if you ever used mut its like pmount but used tcl, he made that. and also when Barry wanted advice on ext4 he went to jesse. Its kind of like his specialty.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#16 Post by steve_s »

ttuuxxx wrote:Hi steve I would take jesse's advice over my advice on this topic any day, lol He knows his stuff when it comes to this sort of thing. I don't know if you ever used mut its like pmount but used tcl, he made that. and also when Barry wanted advice on ext4 he went to jesse. Its kind of like his specialty.
ttuuxxx
Good to know: Jesse knows his stuff on ext4. Yeah, I was agreeing that he is right on...and I appreciate his help...

I am passing on the "flash" drive thingy due to that advice that Jesse gave as I don't think it is worth my efforts, but I may go back and try out the freebsd drive some more just to see why I can't read the "home" folder...I don't know why it can read the /mnt/sdb13 and sdb15 but not 14...perhaps Jesse could give comment on that if possible?

Thanks to both of you either way... 8)

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#17 Post by Jesse »

steve_s wrote:I may go back and try out the freebsd drive some more just to see why I can't read the "home" folder...I don't know why it can read the /mnt/sdb13 and sdb15 but not 14...perhaps Jesse could give comment on that if possible?
From what I recall about FreeBsd, it is pretty pedantic about multi-user security issues, you'll probably find that if you can't read something that the permissions are set such that you can't read from it, check the permissions on all the directorys leading up to (and used with) what you want to look at, e.g. /mnt and /mnt/sdb15 and /dev/sdb15.
Jesse

sotris99
Posts: 69
Joined: Sun 03 Feb 2008, 23:55

#18 Post by sotris99 »

so is there some way to explore bsd partitions?

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#19 Post by amigo »

Compile in support for BSD type partitions(slices) and the filesystems you need into your kernel and then have a go.

Post Reply