Adding an entry for EXT4 partion in /etc/fstab

Hi,

I am dual booting FreeBSD and Ubuntu. My Ubuntu's /home is on a separate EXT4 partition. I want add an entry in fstab so that it gets mounted automatically during boot.

Please help me out.
 
https://wiki.freebsd.org/Ext2fs

In FreeBSD ext2, ext3 and ext4 are not different filesystems: ext2 is the base filesystem and some features from ext3 and ext4 are supported. All features in FreeBSD's implementation follow UFS semantics and this can sometimes impose important differences. In the case of trim support, for example, the code to merge this feature from UFS is relatively simple but while on Linux this is a mount option, in FreeBSD's UFS this has to be set in tunefs, so it's basically unsupported in the BSD ext2fs.

- FreeBSD 9.x+ fully supports the async mode, which is the default on linux. Unlike linux, the default is to use the sync mode which will make your filesystem more reliable at the cost of some performance.

- FreeBSD 11 (and soon 10.1, 9.3), FreeBSD enables by default the dir_index extension. Linux distributions are also starting to enable the feature by default on ext3 and ext4. Unlike linux, we also accept using this feature on ext2.

- FreeBSD 11 also uses by default reallocblk. This comes from UFS and helps preventing defragmentation issues. Linux doesn't have an exact equivalent but Ext4 does delayed allocation which is similar in concept.

- FreeBSD also supports most ext4 features in read-only mode. If your ext4 filesystem was originally converted from ext3 it is likely that you will be able to mount it and take most of the metadata, including complete timestamps and huge files.

NOTE: If you are trying to mount Ext4 partitions remember to specifically mount the filesystem read-only.
 
DutchDaemon said:
https://wiki.freebsd.org/Ext2fs
quote]
.NOTE: If you are trying to mount Ext4 partitions remember to specifically mount the filesystem read-only.

This one is going to cause major inconvenience. Suppose I download a file under FreeBSD I will have to copy it to a flash drive and then reboot and copy it to the Ext4 partition under Linux.

Thanks a lot.
 
If you want a common home partition, I think ZFS is a good choice. If you can, convert your home partition to ZFS (backup your data, "format" to ZFS, restore your data) and that's all :)
 
Alternatively, use a VM and stop having to worry about EXT4 write compatibility. And be able to run both systems at the same time.
 
Code:
******* Working on device /dev/ada0 *******
parameters extracted from in-core disklabel are:
cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 131 (0x83),(Linux native)
    start 2048, size 48828125 (23841 Meg), flag 0
	beg: cyl 0/ head 32/ sector 33;
	end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 131 (0x83),(Linux native)
    start 48830173, size 239081763 (116739 Meg), flag 0
	beg: cyl 1023/ head 254/ sector 63;
	end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
sysid 130 (0x82),(Linux swap or Solaris x86)
    start 304689548, size 7887157 (3851 Meg), flag 0
	beg: cyl 1023/ head 254/ sector 63;
	end: cyl 1023/ head 254/ sector 63
The data for partition 4 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 287911953, size 16777152 (8191 Meg), flag 80 (active)
	beg: cyl 1023/ head 255/ sector 63;
	end: cyl 1023/ head 255/ sector 63

Code:
# file -s /dev/ada0s2
/dev/ada0s2: Linux rev 1.0 ext4 filesystem data, 
UUID=c084cc67-2c4f-4c2d-b192-3d
f5e9429147 (extents) (large files) (huge files)

Code:
# mount -t ext2fs -o ro /dev/ada0s2 /media/linux/
mount: /dev/ada0s2: Invalid argument

I tried a number of combinations but they didn't work.

uzsolt said:
If you want a common home partition, I think ZFS is a good choice. If you can, convert your home partition to ZFS (backup your data, "format" to ZFS, restore your data) and that's all :)

I didn't know that's possible. I am having a tough time copying my files to Linux partition but at the moment I have a huge amount of data, more than my external drive can store, but all those will be gone within a week.

I just found that there's Ubuntu PPA for installing ZFS support. I will create a thread about this topic once I get rid of all those extra data.

wblock@ said:
Alternatively, use a VM and stop having to worry about EXT4 write compatibility. And be able to run both systems at the same time.

Yes that's probably the easiest way but I, for some reason, don't like running any OS other than Windows (which I no longer use) in a VM. Both FreeBSD and Ubuntu works for me.
 
There is also (as far as I know) fuse for linux ext2,3,4.
Fuse is file system in user mode - look in ports.
There is for NTFS for example: fusefs-ntfs, ntfs4g etc.
 
Installed fusefs-ext4fuse-0.1.3,1 package from repository.

Home page says

=== Mounting ===
You can mount a filesystem like this:
$ ext4fuse <device> <mountpoint>

But its not working

Code:
#ext4fuse /dev/ada0s2 /media/linux/ 
fuse: failed to open fuse device: No such file or directory
 
john_rambo said:
Code:
#ext4fuse /dev/ada0s2 /media/linux/ 
fuse: failed to open fuse device: No such file or directory
Try kldload fuse. If you want enable at boot, please add fusefs_enable="YES" to /etc/rc.conf.
 
uzsolt said:
john_rambo said:
Code:
#ext4fuse /dev/ada0s2 /media/linux/ 
fuse: failed to open fuse device: No such file or directory
Try kldload fuse. If you want enable at boot, please add fusefs_enable="YES" to /etc/rc.conf.

It worked. Now I can mount the partition and read the contents as root. Added the line to rc.conf. As user I see the drive icon in PCManFM but when I click on it I get
Code:
Error opening directory '/media/linux' : Opertation not permitted
I have mounted my USB flash drive on /media/pen and I can read it as user so don't know whats going wrong here.
 
Any suggestions? I am really stuck at this point. I tried adding my user account to the operator group, logged out and back in but same thing. Also, despite adding
Code:
fusefs_enable="YES"
to /etc/rc.conf I still need do kldload fuse.
 
Check that your user is allowed to access /media/linux.
If not, try chown <username>:<usergroup> /media/linux (substitute your username and usergroup).
 
bsdkeith said:
Check that your user is allowed to access /media/linux.
If not, try chown <username>:<usergroup> /media/linux (substitute your username and usergroup).

I tried that. It just kept printing invalid argument.

I did #chown user1:user1 /media/linux


t1066 said:
On 10.0, add

Code:
fuse_enable="YES"

to /boot/loader.conf instead to enable fuse.

I am using PCBSD 10 at the moment. Things are a bit easy there for a newbie like me. By default PCBSD selected ZFS and the Ubuntu's

grub was overwritten by PCBSD's grub. I have added an entry in /usr/local/etc/grub.d/40_custom but when I try to boot into

Ubuntu I get
Code:
'Error: Invalid Signature'
.

http://forums.pcbsd.org/showthread.php?t=23024
 
Back
Top