Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I mount my freebsd or windows partition from linux box?

Status
Not open for further replies.

koeicjm

Programmer
Sep 12, 2001
73
JP
I installed linux , windows ,and freebsd all at a hard disk , In my linux box , Can I mount my freebsd
and windows partition ? I can find the list of linux partition from /etc/fstab , but for example I can
not know how what device is my freebsd 's /usr/local or /usr .where can I find the info ? how can I mount it?
 
In order to mount the partitions, all you need to do is to add the partition info and the mount point to your fstab files.

In order to find out what is on each partition, you need to first go into FreeBSD and at the command prompt type mount. This will tell you what partition is mounted where.

In order to mount your Fat partition (Windows, DOS, etc) you just add the lines for that partition to the fstab file.

Example:

Your Windows partition is on the first HDD, and is the first partition. The line to mount it would be (in fstab) /dev/hda1 /mnt/dosc (where /mnt/dosc is the entry point in the linux file system for that device. You can make it anything you want)

Your /usr/home partition in FreeBSD is on the 2nd extended partition on the first drive. The entry for this would be /dev/hda6 /mnt/bsdusrhome

If you need any more info, please let me know.

 
Hi,

BSD is like Solaris in that it uses slices within a physical partition. I can't recall how (if ?) you mount individual slices but you can mount the overall partition :

# mount /dev/hda4 -t ufs -o ufstype=44bsd /mnt/wherever

(Where /dev/hda4 is an example of a partition in which FreeBSD is installed and '/mnt/wherever' is an example of an existing empty directory on linux for the mount point)

For windows vfat it would be :

$ mount /dev/hda1 -t vfat /mnt/whatever

To list your partitions you can do (as root) :

# /sbin/fdisk -l /dev/hda

(list the '/dev/hda' partition table)

For ease of mounting (just using the device name of mount point) you'd want to put appropriate entries in your /etc/fstab .

Hope this helps
 
This is the output of fdisk

# fdisk -l /dev/hda
devic boot start end block ID system
/dev/hda1 1 260 2088418+ 6 FAT16
/dev/hda2 261 293 265072+ 83 Linux
/dev/hda3 294 4180 31222327+ f Win95 (LBA)
/dev/hda4 * 4181 5005 6626812+ a5 BSD/386
/dev/hda5 294 489 1574338+ 83 Linux
/dev/hda6 490 620 1052226 83 Linux
/dev/hda7 621 669 393561 83 Linux
/dev/hda8 670 702 265041 83 Linux
/dev/hda9 703 735 265041 82 Linux swap
/dev/hda10 736 752 136521 83 Linux
/dev/hda11 753 2409 13309821 c Win95 FAT32 (LBA)
/dev/hda12 2410 4180 14225526 7 HPFS/NTFS

I can mount hda1 but cannot mount /hda4
using the command like:
# mount /dev/hda4 -t ufs -o ufstype=44bsd /mnt/wherever

 
Hi,

Thats probably because you don't have the module or, for some reason, its not loading itself. if you do the command :

# find /lib/modules -name "ufs.so"

You should see the ufs module in a subdirectory belonging to your kernel version. Compare to :

# find /lib/modules -name "vfat.so"

If the ufs module is there you can try to do :

# /sbin/modprobe ufs

then repeat the mount command.

Otherwise, you would need a custom kernel compile to create the ufs module.

Also, if you do have the ufs module you can always try a simple :

# mount /dev/hda4 -t ufs /mnt/wherever

or even

# mount /dev/hda4 -t auto /mnt/wherever

See -->
Regards
 
I can not mount it also,The following is
the output of mount at freebsd.

%mount
/dev/ad0s4a on / (ufs, local)
/dev/ad0s4h on /home (ufs, local)
/dev/ad0s4f on /usr (ufs, local)
/dev/ad0s4e on /usr/local (ufs, local)
/dev/ad0s4g on /var (ufs, local)
procfs on /proc (procfs, local)

I cannot find /dev/ad0s4a /dev/ad0s4h /dev/ad0s4f
/dev/ad0s4e /dev/ad0s4g ,but the /dev/hda4
I think I must mount the thoes.but cannot find it.
 
Hi,

FreeBSD creates logical partitions within what is actually a single 'dos' partition. In Solaris terminology these are 'slices' but FreeBSD calls them partitions and the 'dos' partitions are called slices which can get confusing.

The output from your mount command on BSD shows a suffix letter (a, e, f, g, h) . The 's4' means slice 4 or physical partition 4 , i.e. refers to /dev/hda4 . Its roughly similar to an extended 'DOS' partition where you can have logical partitions inside that.

For Solaris and FreeBSD you can mount the individual slices (sub-partitions) by reference to a pseudo device number as long as you have the custom partition table support compiled in for that flesystem For Solaris its called 'solaris (x86) partition label support' and for FreeBSD there is a similar option - ' BSD disklabel (FreeBSD partition tables) support' .

I don't know whether people like redhat activate those options in their standard kernel builds - you can probably tell by looking at the dmesg output, i.e. where it prints out the partition tables of your disk(s). If you have something roughly like this :

[s0] hda9 [s1] hda10 [s2] hda11 [s3] hda12 [s6] hda13 [s7] hda14

... then it recognises the individual slices/sub-partitions . (thats a Solaris example incidentally) You can then mount the pseudo device for the slice using the device numbers shown.

Check dmesg with either :

$ dmesg

or

$ cat /var/log/dmesg

(Look for the lines after "Partition check: ")

If you don't have that support you can't mount the FreeBSD sub-partitions as shown by your mount output. In that case, your only option is to download the kernel source and configure / compile / install a custom kernel . Thats not actually as difficult as it may sound.

Regards



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top