Transfer files (to an iPad)

[root@randy ~]# gpart show -p
=> 40 976773088 ada0 GPT (466G)
40 1024 ada0p1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 4194304 ada0p2 freebsd-swap (2.0G)
4196352 972576768 ada0p3 freebsd-zfs (464G)
976773120 8 - free - (4.0K)

=> 40 976773088 ada1 GPT (466G)
40 1024 ada1p1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 4194304 ada1p2 freebsd-swap (2.0G)
4196352 972576768 ada1p3 freebsd-zfs (464G)
976773120 8 - free - (4.0K)
=> 63 4095999937 da0 MBR (1.9T)
63 1 - free - (512B)
64 4095999936 da0s1 ntfs [active] (1.9T)

[root@randy ~]# gpart show -l
=> 40 976773088 ada0 GPT (466G)
40 1024 1 gptboot0 (512K)
1064 984 - free - (492K)
2048 4194304 2 swap0 (2.0G)
4196352 972576768 3 zfs0 (464G)
976773120 8 - free - (4.0K)

=> 40 976773088 ada1 GPT (466G)
40 1024 1 gptboot1 (512K)
1064 984 - free - (492K)
2048 4194304 2 swap1 (2.0G)
4196352 972576768 3 zfs1 (464G)
976773120 8 - free - (4.0K)

=> 63 4095999937 da0 MBR (1.9T)
63 1 - free - (512B)
64 4095999936 1 (null) [active] (1.9T)
@rpower47 , I am 65 and not far behind in age. I want to see this "copy files to a usb flash driver" work for you, because I might need this same functionality for myself. Maybe you need to be a 'root' user to copy your files to a ntfs mounted usb flash disk drive. Because the FreeBSD operating system is checking FreeBSD user ID against the 'usb flash drive when created' previously recorded the Windows user ID for the main root directory on the usb flash drive. What type of storage device 2 TerraBytes in size is this?. Is that a rotating hard disk drive or a external USB 2TB SSD drive?. (da0 seems like that it is external USB SSD or Hard disk drive)
http://kflu.github.io/2018/02/03/2018-02-03-freebsd-ntfs/ Read This, Randy
Seems like you need to be 'root' user to mount devices, or set User ID, Group ID.

Plug in the external USB SSD drive to the USB port.
issue commands

First, find out the user and group IDs of the preferred user:
# id john
uid=1001(john) gid=1001(john) groups=1001(john),0(wheel)

Now run following command to mount:
Code:
ntfs-3g /dev/da0s1 /mnt -o ro,uid=1001,gid=1001

Now /mnt is owned by john:john.

https://forums.freebsd.org/threads/make-usb-stick-readable-by-windows-10.86277/
There are two distinct varieties of FAT32, see gpart(8), namely fat32 (type 11) and fat32lba (type 12).
The point being, windows 10 itself creates with 'fat32lba type 12' on an MBR scheme, so if you used gpart add '-t fat32lba' rather than '-t fat32', I expect your "local copy centre" should be happy to read the flash drive. Set MBR, Single FAT32 partition works the best on USB Flash Disk Drive Sticks up to 32GB in size.

https://www.softwaretestinghelp.com/exfat-vs-ntfs/#:~:text=In a debate regarding exFAT,on both Windows and macOS.

Below is some more code exercises for examining the disk drive.
Code:
mount | grep da0
dmesg | tail -15
or  dmesg | tail -15 | grep da0

Code:
ls /dev/gpt /dev/gptid /dev/diskid /dev/label
camcontrol inquiry da0
camcontrol devlist
geom disk list
geom part list
gpart status da0
gpart show da0
ls -ld /dev/da0s1
df -h /dev/da0s1
du -h /dev/da0s1

Code:
mkdir  /mnt/randy
ntfs-3g /dev/da0s1  /mnt/randy
mount
ls -ld /mnt/randy
ls -ls /mnt/randy
cd  /mnt/randy
ls -ls
date  > ~/test1.txt
cp ~/test1.txt  /mnt/randy/test1.txt
# ERRORS?    dmesg | tail -15
ls -ls /mnt/randy
su -
root password:
whoami
date >~/test2.txt
cp ~/test2.txt  /mnt/randy/test2.txt
ls -ls /mnt/randy
#check the User IDs in the owner user, group, others from the output of the 'ls' commands.
# I hope this helps you, Randy. I am probably missing some commands to check permissions on files and directories. Somehow to check mounting conditions of the ntfs-3g mounted external USB 2TB drive /dev/da0 /dev/da0s1 to /mnt/randy The s1 is related to MBR (Master Boot Record ) partitioned scheme format that Windows uses for NTFS formatted file systems disks. Windows does NOT handle well GPT formatted NTFS file systems. Got this information from another web page I read.
To create an NTFS partition under GPT you need to specify type ms-basic-data.

gpart is used simply for partiti

oning. Formatting is done using using newfs() (for UFS).

http://www.wonkity.com/~wblock/docs/html/disksetup.html

(da0s1 is also used on the BSD label style MBR scheme, older format that is identified as several partitions with in the larger slice partition).

If it was shown as /dev/da0p1, that would be a UEFI GPT partition type. If you are in Windows, create the drive in the UEFI GPT format scheme. Try again to mount in FreeBSD. I assume that Windows and FreeBSD should be able to deal with either MBR or GPT partition formatting and have the partition file system formatted in NTFS format. Use Linux "gparted" or Windows "diskutil" application to look at the flags and partition types on the drive. gparted.org Puppylinux.com Fossapup 9.5 or Fatdog64 . I suggest these Linux iso files to use as a tool holder for the "Gparted" visual disk partition tool. I have given the command line tools for using FreeBSD. The Gparted is easier to visually understand and to view the "boot Flags" under Partition ---> Manage Flags button. Check that the "boot" flag and the "esp" flag are checked off.

Here is code section of commands to use the blank out an existing flash desk and format to GPT scheme and add 2 partitions, 1 in ExFAT, the next in NTFS. I don't have the proper format the file system on each of these partitions. I Will look on google and edit here.

Code:
dd if=/dev/zero of=/dev/da0 bs=1M
gpart create -s MBR da0
gpart add -t ntfs -s 29G da0
gpart add -t freebsd da0
gpart create -s BSD da0s2
gpart add -t freebsd-ufs da0s2

https://chieflemming.wordpress.com/2020/01/08/formatting-partitioning-and-mounting-drives-for-ntfs-with-freebsd-and-mac-os-x/
[LIST=1]
[*]Now the drive needs a filesystem:
mkntfs /dev/da0s1
This command takes a long time and then fails. There is a -Q (also -f) for quick format, which hangs at creating the backup boot sector when displayed with -v.
Solution: set the environment variable NTFS_USE_UBLIO=0 before running the above command. Details below.
[*]export NTFS_USE_UBLIO
[/LIST]
# a different example for 2 TB, may be incorrect, creates label names, maybe use MBR scheme format.
gpart destroy /dev/da0
gpart  create -s GPT /dev/da0
gpart add  -a 4k  -l "EFI_FAT32_ESP" -t FAT32 -s 700mb /dev/da0
gpart add -a 1m -l "Randy_ExFat" -t ms-basic-data -s 1TB /dev/da0
gpart add -a 1m -l "Randy_ntfs" -t ms-basic-data -s 1TB /dev/da0
gpart show -lp /dev/da0
gpart status /dev/da0
geom disk list da0

NTFS_USE_UBLIO=0
export NTFS_USE_UBLIO
mkntfs -vf /dev/da0s1

These are generic ideas, that I have to seach for correct mkfs commands.
Make the file systems. Then check the file systems before use.
Code:
newfs_msdos -F32  /dev/da0p1
# mkfs.exfat /dev/da0p2  Guess there is not a good FreeBSD method. u\
Use Windows to format partition in ExFAT if you wish to format file system.
# mkfs.ntfs /dev/da0p3
fsck.fat  /dev/da0p1
fsck.exfat  /dev/da0p2
fsck.ntfs   /dev/da0p3

gpart create -s mbr da0
gpart add -t fat32 da0
newfs_msdos -F32 /dev/da0s1

I put a lot of copy and paste in this post to get most of the relevant information together. I will wait a few days and see about a good edit. Showed the proper NTFS format. Now looking for FAT32 format command. FreeBSD does not support creating ExFAT formatted drive.
 
NTFS mounting, reading, writing and arithmetic

http://linux-bsd-sharing.blogspot.com/2012/01/howto-mounting-ntfs-partition-in-write.html

https://chieflemming.wordpress.com/...ng-drives-for-ntfs-with-freebsd-and-mac-os-x/

This is one of the least helpful error messages I can imagine. gpart doesn’t let you create a partition with type “ntfs” on a disk with a GPT partition table. You’d need to make a MBR partition table instead.

https://www.gridbugs.org/ntfs-on-freebsd/

Examples to read:
https://forums.freebsd.org/threads/formatting-a-hard-disk-drive.66043/

Best Wishes in writing files to NTFS formatted file system on an external USB Drive. I welcome corrections and comments below. I can edit / modify my posts to be better with your help.
 
Back
Top