26dd4 [Solved] mounting Linux FS - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old December 9th, 2008, 14:45
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default mounting Linux FS

Hi there.
I completed the installation of FreeBSD on my comp.

My computer has 2 HDD. On the first HDD I have Ubuntu and I think but not sure that has ext3 FS.

I created the mount point an try some:
Code:
# fdisk -l
fdisk: illegal option -- l
usage: fdisk [-BIaipstu] [-b bootcode] [-1234] [disk]
       fdisk -f configfile [-itv] [disk]
and
Code:
# # ls /dev/
acd0            cuad0.init      kbdmux0         stdout          ttyvb
acpi            cuad0.lock      klog            sysmouse        ttyvc
ad6             cuad1           kmem            ttyd0           ttyvd
ad6s1           cuad1.init      log             ttyd0.init      ttyve
ad6s2           cuad1.lock      mdctl           ttyd0.lock      ttyvf
ad6s5           dcons           mem             ttyd1           ukbd0
ad8             devctl          net             ttyd1.init      ums0
ad8s1           devstat         net1            ttyd1.lock      urandom
ad8s1a          dgdb            net2            ttyp0           usb
ad8s1b          dumpdev         net3            ttyp1           usb0
ad8s1c          fd              net4            ttyv0           usb1
ad8s1d          fido            network         ttyv1           usb2
ad8s1e          fw0             nfs4            ttyv2           usb3
ad8s1f          fw0.0           nfslock         ttyv3           usb4
ata             fwmem0          null            ttyv4           usb5
atkbd0          fwmem0.0        pci             ttyv5           usb6
audit           geom.ctl        ptyp0           ttyv6           usb7
console         io              ptyp1           ttyv7           xpt0
consolectl      kbd0            random          ttyv8           zero
ctty            kbd1            stderr          ttyv9
cuad0           kbd2            stdin           ttyva
How can I mount the Linux HDD and where is in /dev?
it is ad6, ad6s1, ad6s2, ad6s5?

thanks
Reply With Quote
  #2  
Old December 9th, 2008, 14:55
Ole Ole is offline
Junior Member
 
Join Date: Nov 2008
Location: Saint-Petersburg, Russia
Posts: 72
Thanks: 3
Thanked 9 Times in 8 Posts
Default

for view slices and partition type:

fdisk -p /dev/ad6
and then
Code:
mount -o ro -t ext2fs /dev/ad6s1 /mnt
or
mount -o ro -t ext2fs /dev/ad6s2 /mnt
Reply With Quote
  #3  
Old December 9th, 2008, 14:56
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,021 Times in 1,860 Posts
Default

Try fdisk ad6 and fdisk ad8. That should show you the ext3 partition. If it's on the first disk it's probably ad6s1.
Reply With Quote
  #4  
Old December 9th, 2008, 15:29
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

Code:
# fdisk -p /dev/ad6                      
# /dev/ad6                                      
g c969021 h16 s63                               
p 1 0x83 63 953409492                           
a 1                                             
p 2 0x05 953409555 23358510
and
Code:
# fdisk ad6
******* Working on device /dev/ad6 *******
parameters extracted from in-core disklabel are:
cylinders=969021 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=969021 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 63, size 953409492 (465531 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 5 (0x05),(Extended DOS)
    start 953409555, size 23358510 (11405 Meg), flag 0
        beg: cyl 1023/ head 254/ sector 63;
        end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
I suppose that the disk ad6 has 2 partitions, one is ext2fs and the other is swap
So I suppose
ad6s1 is the root / partition with ext2fs
ad6s2 is the swap partition
ad6s5 .... I don't know
Reply With Quote
  #5  
Old December 9th, 2008, 16:05
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

well I tried:
Code:
# mount -o ro -t ext2fs /dev/ad6s1 /disc01/
# ls /disc01
ls: /disc01: Bad file descriptor
# mount -o ro -t ext2fs /dev/ad6s2 /disc01/
mount: /disc01: Bad file descriptor
where is the problem?
Reply With Quote
  #6  
Old December 9th, 2008, 16:10
adamk adamk is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,605
Thanks: 6
Thanked 262 Times in 243 Posts
Default

You need to apply this patch to your kernel sources and rebuild at least the ext2fs kernel module:

http://pastebin.ca/raw/1280738

The ext2fs kernel module currently available in -STABLE (and maybe -CURRENT) does not support inode sizes higher than 128, and many distributions now use 256.

Adam
Reply With Quote
  #7  
Old December 9th, 2008, 16:12
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

well after this I could not read the /disc01 directory (I created for mount point) so I restarted the system. A lot of numbers appear on the screen and finally "Giving up on 27 buffers". What does it means?
Reply With Quote
  #8  
Old December 9th, 2008, 16:16
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by adamk View Post
You need to apply this patch to your kernel sources and rebuild at least the ext2fs kernel module:

http://pastebin.ca/raw/1280738
I never apply apatch to the kernel and I don't know how to do it. Can you give my some hints?

Thanks
Reply With Quote
  #9  
Old December 9th, 2008, 16:52
brd@'s Avatar
brd@ brd@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Denver, CO, USA
Posts: 277
Thanks: 0
Thanked 50 Times in 29 Posts
Default

Quote:
Originally Posted by adamk View Post
You need to apply this patch to your kernel sources and rebuild at least the ext2fs kernel module:

http://pastebin.ca/raw/1280738

The ext2fs kernel module currently available in -STABLE (and maybe -CURRENT) does not support inode sizes higher than 128, and many distributions now use 256.

Adam
Is there a PR that references this patch?
Reply With Quote
  #10  
Old December 9th, 2008, 17:28
gnemmi's Avatar
gnemmi gnemmi is offline
Member
 
Join Date: Nov 2008
Location: Cap. Fed., Buenos Aires, Argentina
Posts: 219
Thanks: 35
Thanked 21 Times in 18 Posts
Default

Yes there is brd@ you can find it in here:

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/124621

Here you can find the patch that I used:

http://pflog.net/~floyd/ext2fs.diff

More on this topic:

mounting linux partitions
Fri May 9 18:05:26 UTC 2008
http://lists.freebsd.org/pipermail/f...ay/174588.html

bad file descriptor when mounting an ext2fs.
Tue Jun 10 11:08:46 UTC 2008
http://lists.freebsd.org/pipermail/f...ne/176506.html

mounting ext2fs partitions on FBSD7 ( third time a charm?)
Fri Jul 4 23:33:53 UTC 2008
http://lists.freebsd.org/pipermail/f...ly/178219.html

256-byte inode support
Sat Sep 6 23:46:33 UTC 2008
http://lists.freebsd.org/pipermail/f...er/025912.html

ext2 inode size patch - RE: PR kern/124621
Mon Nov 24 11:29:59 PST 2008
http://lists.freebsd.org/pipermail/f...er/046758.html

ext2 inode size patch - RE: PR kern/124621
Wed Dec 3 14:53:46 PST 2008
http://lists.freebsd.org/pipermail/f...er/046916.html

I´ve had a conversation with Josh (email) and he kindly explained me how to apply the patch and test it. So far, so _good_ to me ... not a single problem on daily usage.

Hope you find that info usefull

Regards
Reply With Quote
  #11  
Old December 12th, 2008, 17:49
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

Reading the above links I don't understand if it's possible or not to mount Linux volumes.

All my information are in Linux volume and I don't know how to transfer them in FreeBSD.

I tried to mount the FreeBSD volume in Linux but no chance ...
Reply With Quote
  #12  
Old December 13th, 2008, 05:44
gnemmi's Avatar
gnemmi gnemmi is offline
Member
 
Join Date: Nov 2008
Location: Cap. Fed., Buenos Aires, Argentina
Posts: 219
Thanks: 35
Thanked 21 Times in 18 Posts
Default

You can mount ext2/3fs as long as they have an "Inode size" equal to 128.

Otherwise (if "Inode size" equals 256), you won't be able to mount those ext2/3 partitions unless you apply Josh's patch. Or to be more spesific ... you will be able to mount them but you won't be able to acces the data on them .. and you'll get a "Bad file descriptor" every time you try to acces said mounted partition.

In order to find out whether your ext2/3 partitions have a 128 or a 256 "Inode size", issue the following command as root:

Code:
root@inferna:~ # tune2fs -l /dev/ad4s6 | grep "Inode size"
Inode size:               256
of course .. you will have to change "/dev/ad4s6" to the correct ext2/3 linux partition in your drive ...

At leas that was my experience ..

Hope that helps
Reply With Quote
  #13  
Old December 13th, 2008, 10:29
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by gnemmi View Post
In order to find out whether your ext2/3 partitions have a 128 or a 256 "Inode size", issue the following command as root:

Code:
root@inferna:~ # tune2fs -l /dev/ad4s6 | grep "Inode size"
Inode size:               256
well I tried
Code:
# tune2fs -l /dev/ad6s1 | grep "Inode size"
tune2fs: Command not found.
# whatis tune2fs
tune2fs: nothing appropriate
maybe I have to install something?
Reply With Quote
  #14  
Old December 13th, 2008, 10:33
gnemmi's Avatar
gnemmi gnemmi is offline
Member
 
Join Date: Nov 2008
Location: Cap. Fed., Buenos Aires, Argentina
Posts: 219
Thanks: 35
Thanked 21 Times in 18 Posts
Default

Code:
[gonzalo@inferna ~]% which tune2fs
/usr/local/sbin/tune2fs
[gonzalo@inferna ~]% pkg_info -W /usr/local/sbin/tune2fs
/usr/local/sbin/tune2fs was installed by package e2fsprogs-1.41.3
[gonzalo@inferna ~]% pkg_info -xqo e2fsprogs
sysutils/e2fsprogs
[gonzalo@inferna ~]%
Hope it helps
Reply With Quote
The Following 2 Users Say Thank You to gnemmi For This Useful Post:
hirohitosan (December 13th, 2008), nhanquy (July 25th, 2009)
  #15  
Old December 13th, 2008, 12:06
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by gnemmi View Post
Hope it helps
yes, it helps but unfortunately in my case:
Code:
 tune2fs -l /dev/ad6s1 | grep "Inode size"                              Inode size:               256
at this time as my system works I'm afraid to apply Josh's patch. I never apply a patch to my kernel sources and rebuild ... it's complicated?
Reply With Quote
  #16  
Old December 13th, 2008, 13:56
Djn Djn is offline
Member
 
Join Date: Nov 2008
Location: Horten, Norway
Posts: 392
Thanks: 3
Thanked 62 Times in 53 Posts
Default

It's not too hard, really.
If you
Code:
# cd /usr/src/sys/gnu/fs
# patch < ~djn/ext2fs.diff  (change to where you stored the patch, obviously)
# cd /usr/src/sys/modules/ext2fs
# make install clean
This will compile and install the patched version of the ext2fs module. If it's already loaded you need to kldunload ext2fs; kldload ext2fs, otherwise you should just be able to kldload it and try.

If you have ext2fs compiled into the kernel (options EXT2FS) you would need to cd /usr/src ; make buildkernel installkernel to compile a new kernel. I doubt you have, though - it's not the default.
Reply With Quote
  #17  
Old December 13th, 2008, 19:37
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

I don't have nothing in /usr/src
Code:
# ls -al /usr/src/
total 4
drwxr-xr-x   2 root  wheel  512 Feb 24  2008 .
drwxr-xr-x  17 root  wheel  512 Dec  9 10:02 ..
do I need something to install? the kernel sources or something like that?
Reply With Quote
  #18  
Old December 14th, 2008, 23:34
gnemmi's Avatar
gnemmi gnemmi is offline
Member
 
Join Date: Nov 2008
Location: Cap. Fed., Buenos Aires, Argentina
Posts: 219
Thanks: 35
Thanked 21 Times in 18 Posts
Default

You need to install the sources first ..
You can do so using "sysinstall" ...

Code:
root@inferna:~ # sysinstall
Then go to "Configure" -> "Distributions", select (at least) "base" and "kernels" or go for "All" if you want to .. then hit "OK" and that should pretty much do it

You should check the Handbook first though ... it's been a while since I don't use "sysinstall" so I might be wrong :s
Reply With Quote
  #19  
Old December 15th, 2008, 13:38
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Djn View Post
This will compile and install the patched version of the ext2fs module. If it's already loaded you need to kldunload ext2fs; kldload ext2fs, otherwise you should just be able to kldload it and try.

If you have ext2fs compiled into the kernel (options EXT2FS) you would need to cd /usr/src ; make buildkernel installkernel to compile a new kernel. I doubt you have, though - it's not the default.
I installed kernel sources and I downloaded ext2fs.diff and then:

Code:
# cd /usr/src/sys/gnu/fs/
# patch < ~/ext2fs.diff
Hmm...  Looks like a unified diff to me...     
The text leading up to this was:
--------------------------
|diff -ud ext2fs.orig/ext2_fs.h ext2fs/ext2_fs.h
|--- ext2fs.orig/ext2_fs.h      2005-06-16 06:51:38.000000000 +0000
|+++ ext2fs/ext2_fs.h   2008-09-03 14:10:27.000000000 +0000
--------------------------
Patching file ext2fs/ext2_fs.h using Plan A...
Hunk #1 succeeded at 150.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ud ext2fs.orig/ext2_inode.c ext2fs/ext2_inode.c
|--- ext2fs.orig/ext2_inode.c   2006-09-26 04:15:58.000000000 +0000
|+++ ext2fs/ext2_inode.c        2008-09-03 13:54:49.000000000 +0000
--------------------------
Patching file ext2fs/ext2_inode.c using Plan A...
Hunk #1 succeeded at 91.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ud ext2fs.orig/ext2_vfsops.c ext2fs/ext2_vfsops.c
|--- ext2fs.orig/ext2_vfsops.c  2008-04-03 18:51:13.000000000 +0000
|+++ ext2fs/ext2_vfsops.c       2008-09-03 13:55:37.000000000 +0000
--------------------------
Patching file ext2fs/ext2_vfsops.c using Plan A...
Hunk #1 succeeded at 424.
Hunk #2 succeeded at 578.
Hunk #3 succeeded at 1013.
done
# cd /usr/src/sys/modules/ext2fs/
# make install clean
install -o root -g wheel -m 555   ext2fs.ko /boot/kernel
install: ext2fs.ko: No such file or directory
*** Error code 71
something is missing? what went wrong?
Reply With Quote
  #20  
Old December 15th, 2008, 16:20
gnemmi's Avatar
gnemmi gnemmi is offline
Member
 
Join Date: Nov 2008
Location: Cap. Fed., Buenos Aires, Argentina
Posts: 219
Thanks: 35
Thanked 21 Times in 18 Posts
Default

Try a:

Code:
root@inferna:/usr/src/sys/modules/ext2fs # make clean && make
a past the output in here.
Reply With Quote
  #21  
Old December 15th, 2008, 21:36
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

I didn't understand the command so I paste it like this:
Code:
# /usr/src/sys/modules/ext2fs # make clean && make
/usr/src/sys/modules/ext2fs: Permission denied.
Reply With Quote
  #22  
Old December 16th, 2008, 02:24
gnemmi's Avatar
gnemmi gnemmi is offline
Member
 
Join Date: Nov 2008
Location: Cap. Fed., Buenos Aires, Argentina
Posts: 219
Thanks: 35
Thanked 21 Times in 18 Posts
Default

are you doing this as root?
could you please do a "ls -a" inside that directory and paste the output in here?
Reply With Quote
  #23  
Old December 16th, 2008, 14:48
lme@'s Avatar
lme@ lme@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Düsseldorf, Germany
Posts: 588
Thanks: 44
Thanked 181 Times in 90 Posts
Default

hirohitosan, you should exec this this as root:
Code:
# cd /usr/src/sys/modules/ext2fs
# make depend
# make obj
# make
# make install
# make unload
# make load
That way you build all dependencies for the module, build the module itself, install it, unload the current loaded module and load the new one.
Reply With Quote
The Following 2 Users Say Thank You to lme@ For This Useful Post:
hirohitosan (December 16th, 2008), Voltar (July 26th, 2009)
  #24  
Old December 16th, 2008, 15:16
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by lme@ View Post
hirohitosan, you should exec this this as root:
Code:
# cd /usr/src/sys/modules/ext2fs
# make depend
# make obj
# make
# make install
# make unload
# make load
That way you build all dependencies for the module, build the module itself, install it, unload the current loaded module and load the new one.
Thanks everything went well. Just
Code:
# make unload
/sbin/kldunload -v ext2fs.ko
kldunload: can't find file ext2fs.ko
*** Error code 1

Stop in /usr/src/sys/modules/ext2fs.
# make load
/sbin/kldload -v /usr/obj/usr/src/sys/modules/ext2fs/ext2fs.ko
Loaded /usr/obj/usr/src/sys/modules/ext2fs/ext2fs.ko, id=4
but I suppose that ext2fs was not loaded ....
Reply With Quote
  #25  
Old December 16th, 2008, 16:04
hirohitosan's Avatar
hirohitosan hirohitosan is offline
Member
 
Join Date: Nov 2008
Posts: 276
Thanks: 62
Thanked 0 Times in 0 Posts
Default It works \(0_0)/

thank you guys ... now I can mount the ext2 volume ... nice tutorial
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Mounting a drive xsiick General 30 April 24th, 2009 17:16
mounting devices alxgomz Peripheral Hardware 7 April 1st, 2009 08:35
Mounting a harddrive Roberth General 11 January 20th, 2009 03:55
ISCSI Mounting Help Biker803 System Hardware 4 December 4th, 2008 19:28
ISCSI Mounting Help Biker803 General 0 December 3rd, 2008 20:04


All times are GMT +1. The time now is 02:42.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0