# How to mount msdos and ext3?



## zeiz (Nov 23, 2008)

Hello everybody!
I enjoy exploring of FreeBSD-7.1-BETA2 with Gnome and I'd like to setup mounting and unmounting fat32 and ext3 partitions with fstab so that they could appear in Computer window unmounted (like in Ubuntu) and then mount/umount them with double click or right click menu.
Fat32 is a primary partition but Linuxes reside on extended one. 
Is this actually possible in FreeBSD? If yes HOW?
Many thanks in advance


----------



## Mel_Flynn (Nov 23, 2008)

You will need to configure HAL. Extensive docs are here.
Most notably, give your user the privilege of mounting fixed disks.


----------



## zeiz (Nov 23, 2008)

Very useful. Thank you very much!


----------



## zeiz (Nov 23, 2008)

Thanks Mal_Flynn I can mount now fat32 and even ntfs in the way I wanted.
I can also mount ext3 but I cannot open it.
From "Removable media":
Could not open location 'file:///media/disk'
Bad file handle.
(anyway it's mounted but cannot be opened)
From "Computer":
Couldn't display "/media/disk".
There is no application installed for this file type
How to fix?


----------



## Mel_Flynn (Nov 23, 2008)

Hmm, that could be related to ext3 support. I've read some issues on the freebsd-questions list regarding it and remember that people mounting it as ext2 resolved their problems. Only when the ext3 system is 'dirty', it needs a journal playback, which ext2 cannot handle.
It should be possible to tell HAL to mount a volume with specific arguments, using the FDI, however, it's probably best to confirm whether this is the underlying cause, by mounting it by hand and trying to access the disk contents.


----------



## zeiz (Nov 23, 2008)

Yes, I read about ext2 instead of ext3 but it doesn't help:
#mount -t ext2fs /dev/ad4s7 /mnt
mount: /mnt: Bad file descriptor
#mount -t ext2fs /dev/ad4s7 /linux
mount: permission denied
Since I commented out everything in fstab except
proc          /proc        procfs     rw   0 0
/dev/ad4s2a   /            ufs        rw   1 1
I tried to add
/dev/ad4s7    /mnt         ext2fs     rw   0 0
and then mount in terminal but got same error.
What else can I try?


----------



## Mel_Flynn (Nov 24, 2008)

This looks accurate.


----------



## zeiz (Nov 24, 2008)

No luck I have those tools and I fsck'ed the partition: all passed. The partition can be mounted but cannot be accessed (I even tried to log in as "root"). When mounted ls -l gives "bad file descriptor" when unmounted:
crw-r-----1root operator 0
On the other hand I have RoFreeSBIE installed on another machine. I can mount Linux partitions there problem free. It has a line in fstab:
linprocfs     /compat/linux/proc    linprocfs    rw  0 0
I has /compat directory filled in with lots of stuff (looks like full Fedora.
I tried to add the line to my fstab (with the dirs made) but no luck


----------



## dodo1122 (Nov 25, 2008)

This is probably because your ext3 partition has 256-byte inode size. Freebsd can't handle that yet, although that's nothing a simple patch can't fix. Best thing would be to either edit the hardcoded 128-byte inode size in the kernel, or simply remake the partition specifying 128-byte inodes (the default changed in e2fsprogs, because of ext4). 

dodo


----------



## zeiz (Nov 25, 2008)

Wow... But thanks a lot, looks that's the case:
# tune2fs -l /dev/ad4s6 | grep Inode ## Ubuntu8.10-86_64 ext3 partition
Inode count:              2949120
Inodes per group:         8192
Inode blocks per group:   512
Inode size:	          256

# tune2fs -l /dev/ad4s7 | grep Inode  ## openSUSE-11.1-i386 ext3 partition
Inode count:              2889216
Inodes per group:         8208
Inode blocks per group:   513 
Inode size:	          256

# tune2fs -l /dev/ad4s9 | grep Inode  ## empty ext2 partition
Inode count:              2818048
Inodes per group:         8192
Inode blocks per group:   512
Inode size:	          256

On the other hand:
# tune2fs -l /dev/ad4s4 | grep Inode ##accessible fat32 storage partition
tune2fs: Bad magic number in super-block while trying to open /dev/ad4s4
Couldn't find valid filesystem superblock.
# tune2fs -l /dev/ad4s1 | grep Inode ##accessible ntfs XP partition
tune2fs: Bad magic number in super-block while trying to open /dev/ad4s1
Couldn't find valid filesystem superblock.
# tune2fs -l /dev/ad4s2 | grep Inode ##FreeBSD7.1b2 i386 own partition
tune2fs: Bad magic number in super-block while trying to open /dev/ad4s2
Couldn't find valid filesystem superblock.
# tune2fs -l /dev/ad4s2a ## / FreeBSD
tune2fs: Bad magic number in super-block while trying to open /dev/ad4s2a
Couldn't find valid filesystem superblock.

Indeed on another machine where RoFreeSBIE could reach same Ubuntu8.10(but i386) partition it's inode size is 128. On the other hand from Ubuntu RoFreeSBIE partition shows same "Bad magic..." as above and next after Ubuntu Mandriva2009 shows 256.
What specifies inode size?

General picture. SATA-500GB. 1stPP -XP; 2ndPP-FreeBSD; 3rdEP-Linuxes (5LD-swap;6LD-ubuntu;7LDsuse;8LD-empty;9LD-empty);4thPP-storage.
Before installing FreeBSD I had XP and Ubuntu; with PartedMagic (gparted) I srinked XP from 45to30GB,moved future FreeBSD partition to empty space,grew Linuxes' Extented to empty space, inside extended moved swap to empty space and grew Ubuntu partition from 100 to 115GB, 100GB of storage- intact.
As a result I can reach from FreeBSD 2 primary partitions and I cannot reach the extended.
As I understood the easiest way is to remake the extended partition only and reinstall Ubuntu and Suse. Too pitty (they are tuned) but no choice. However how can I specify 128-byte inodes during remaking and reinstall? And what to do with "Bad magic...?


----------

