# Mounting hard drives(NTFS)/USB storages(FAT32 or exFAT), etc on FreeBSD 12.2



## jjsingh (Oct 29, 2020)

Hi Everyone,
I'm coming from the LINUX to try FreeBSD. I downloaded and created bootable USB stick of FreeBSD 12.2 DVD ISO and booted into FreeBSD as a livefs. I've wanted to store the output of below cmds to check hardware compatibility of my device.

```
# mount -u -o rw /
# dmesg > /dmesg.out.txt
# pciconf -lv > /pciconf.out.txt
# devinfo -v > /devinfo.out.txt
# acpidump -dt > /acpidump.out.txt
# mount -u -o ro / ; sync
# zzz
```

But it seems like the above cmds are not working and giving me "system is read only" errors. I even tried to mount my internal/external hard drives but that too didn't worked. I tried searching about how mount cmd work in FreeBSD but that to didn't work for me. Also it seems ntfs-3g is not available in FreeBSD 12.2 live dvd.
So I'd be thankful if you can answers below queries:
1) How to mount internal hard drive in FreeBSD using only livefs?
2) How to mount external hard drive(NTFS) in FreeBSD using only livefs?
3) How to mount different internal hard drive partitons(may/maynot NTFS) in FreeBSD using only livefs?
4) How to mount external USB drive(may/maynot FAT32) in FreeBSD using only livefs?
5) How to mount external USB drive which is bootable in FreeBSD as rw using only livefs?

Answers to the above queries may be similar in a sense.
Thanks,


----------



## SirDice (Oct 29, 2020)

jjsingh said:


> I downloaded and created bootable USB stick of FreeBSD 12.2 DVD ISO


Use the memstick images. 



jjsingh said:


> But it seems like the above cmds are not working and giving me "system is read only" errors.


ISO images are set up differently because CDs are read-only.



jjsingh said:


> Also it seems ntfs-3g is not available in FreeBSD 12.2 live dvd.


It's not part of the base OS, it's additional, third-party, software that has to be installed.


----------



## jjsingh (Oct 29, 2020)

SirDice said:


> Use the memstick images.
> 
> 
> ISO images are set up differently because CDs are read-only.
> ...


Thanks for the reply SirDice, Is this mean FreeBSD ISOs are set up differently than those of LINUXs? Also if I use memsticks will I be able to mount NTFS and FAT32/exFAT as rw? if yes, can you provide me with a cmd to mount different partitions of the same drive in a live environment?(Sorry for this as it seems FeeBSD /dev/* partions works in a different way as that of LINUX).


----------



## SirDice (Oct 29, 2020)

jjsingh said:


> Is this mean FreeBSD ISOs are set up differently than those of LINUXs?


Definitely. 



jjsingh said:


> Also if I use memsticks will I be able to mount NTFS and FAT32/exFAT as rw?


Well, you won't have a problem writing to the filesystem. And because /mnt is writable you can use it to mount too. FAT shouldn't be a problem (msdosfs(5)), NTFS is still problematic because sysutils/fusefs-ntfs is not part of the base OS and thus not installed.

On the ISO images the root filesystem is read-only permanently, because CDs are read-only. There is a memory disk mounted on /tmp. You can use /tmp/mnt as a temporary mountpoint.


----------



## T-Daemon (Oct 29, 2020)

jjsingh said:


> 1) How to mount internal hard drive in FreeBSD using only livefs?


Depends on the file system type of the hard drive.



jjsingh said:


> 2) How to mount external hard drive(NTFS) in FreeBSD using only livefs?


Install third-party sysutils/fusefs-ntfs









						FreeBSD LiveCD - installing a small set of tools from packages on read-only file system
					

If you ever happen to use a LiveCD to restore or diagnose some computer and you have only the Bootable DVD you can use this method to install additional software that you need in the ram drive. In the following example i will show you how to boot and install sysutils/testdisk midnight-commander...




					forums.freebsd.org
				






jjsingh said:


> 3) How to mount different internal hard drive partitons(may/maynot NTFS) in FreeBSD using only livefs?


Depends on the file system type of the hard drive. If the file system is supported from base system then it's easy, if NTFS or other not from base system supported see answer #2.



jjsingh said:


> 4) How to mount external USB drive(may/maynot FAT32) in FreeBSD using only livefs?


`mount_msdofs /dev/daX /mnt`

Replace X with shown device node in dmesg, e.g.: da0s1

If maynot, depends on the file system type.



jjsingh said:


> 5) How to mount external USB drive which is bootable in FreeBSD as rw using only livefs?


Depends on the file system type.


----------



## T-Daemon (Oct 29, 2020)

jjsingh said:


> I've wanted to store the output of below cmds to check hardware compatibility of my device.
> Code:
> # mount -u -o rw /
> # dmesg > /dmesg.out.txt
> ...



Plug in a second, msdosfs formated, USB stick, save there.


----------



## T-Daemon (Oct 29, 2020)

If there is no USB device at hand, and you have a internet connection (run `dhclient <interface>`, find interface with ifconfig(8)), redirect all commands to /tmp/compatfile (don't forget to use the `>>` operator after first command, redirect some empty echo(1) lines to have space between the outputs), send it to a pastebin site:

`cat /tmp/compatfile | nc termbin.com 9999`

That will return a URL, from there you can fetch the info.


----------



## jjsingh (Oct 31, 2020)

Thanks SirDice and T-Daemon. I think that's all the info I need for now.


----------

