Page 1 of 3

Can't write to USB flash drive

Posted: Fri Apr 23, 2021 3:17 am
by security_lover
Hi,

I am using a using a Sandisk 32GB flash drive for backup. I don't need to backup a lot of data so 32GB is enough for me.
The filesystem on the flash drive is FAT32. When I plug in the drive GhostBSD does not auto mount it. So I search the web & found the command :

Code: Select all

mount_msdosfs /dev/da0s1 /media/usb
Problem is I can read data but can't write anything to it. As a temporary solution I launched the terminal, gained root privilage & used the "cp" command to copy some files one by one.

To solve this problem under Linux I use the "chown" command but that command is not working under GhostBSD.

Example of chown command under Linux:

Code: Select all

chown -R username:username /media/usb
Is the chown command used differently under GhostBSD ?

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 7:42 am
by NevilleGoddard
Are you sure nothing is being written? Drag and drop something to the USB, close the window, then reopen it. You should then see the file there

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 7:43 am
by NevilleGoddard
The USB should automatically mount

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 7:50 am
by security_lover
NevilleGoddard wrote: Fri Apr 23, 2021 7:43 am The USB should automatically mount
It's not mounting automatically.

Code: Select all

~> lsblk 
DEVICE         MAJ:MIN SIZE TYPE                              LABEL MOUNT
ada0             0:111 149G GPT                                   - -
  <FREE>         -:-   1.0M -                                     - -
  ada0p1         0:113 149G linux-data                            - /media/seagate
  <FREE>         -:-   840K -                                     - -
ada1             0:116 112G GPT                                   - -
  <FREE>         -:-   1.0M -                                     - -
  ada1p1         0:122 512M efi                gpt/EFI%20System%20Partition -
  ada1p2         0:124  87G linux-data         gptid/16f97e48-efef-4bf9-9c14-48eb11b99746 -
  ada1p3         0:126  24G freebsd-zfs                           - <ZFS>
  <FREE>         -:-   456K -                                     - -
da0              0:147  30G MBR                                   - -
  <FREE>         -:-   993K -                                     - -
  da0s1          2:188  30G fat32                    msdosfs/BACKUP -

Code: Select all

~> mount
tank/ROOT/initial on / (zfs, local, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
tmpfs on /libexec/rc/init.d (tmpfs, local, noexec, nosuid)
procfs on /proc (procfs, local)
linprocfs on /compat/linux/proc (linprocfs, local)
tmpfs on /compat/linux/dev/shm (tmpfs, local)
linsysfs on /compat/linux/sys (linsysfs, local)
fdescfs on /dev/fd (fdescfs)
tank/usr/home on /usr/home (zfs, local, nfsv4acls)
tank/usr/src on /usr/src (zfs, local, nfsv4acls)
tank/tmp on /tmp (zfs, local, nosuid, nfsv4acls)
tank/var/crash on /var/crash (zfs, local, noexec, nosuid, nfsv4acls)
tank/var/audit on /var/audit (zfs, local, noexec, nosuid, nfsv4acls)
tank/usr/ports on /usr/ports (zfs, local, nosuid, nfsv4acls)
tank/var/mail on /var/mail (zfs, local, nfsv4acls)
tank/var/tmp on /var/tmp (zfs, local, nosuid, nfsv4acls)
/dev/ada0p1 on /media/seagate (ufs, local)
NevilleGoddard wrote: Fri Apr 23, 2021 7:42 am Are you sure nothing is being written? Drag and drop something to the USB, close the window, then reopen it. You should then see the file there
After mounting it manually when I try to copy a file this happens :
readonly.png
That's ^^ the problem.

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 7:54 am
by security_lover
When I try the "chown" command this happens :

Code: Select all

chown -R bsd /media/usb/ 

Code: Select all

chown: /media/usb/GhostBSD-21.01.20.iso: Invalid argument
chown: /media/usb/lmde-4-cinnamon-64bit.iso: Invalid argument

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 8:32 am
by security_lover
I just formatted the USB drive from FAT32 to UFS. The chown command worked under UFS. I can write to the device now.

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 9:36 am
by ericbsd
@security_lover

Code: Select all

pkg install upgrade -f automount
If you are on the last release on the website you should upgrade automount and it will fix your problem.

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 9:44 am
by security_lover
@ericbsd

Code: Select all

# pkg install upgrade -f automount
Updating GhostBSD repository catalogue...
GhostBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'upgrade' have been found in the repositories
pkg: No packages available to install matching '-f' have been found in the repositories

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 9:46 am
by security_lover
I have installed using this iso >>> GhostBSD-21.01.20.iso

Re: Can't write to USB flash drive

Posted: Fri Apr 23, 2021 9:55 am
by ericbsd
security_lover wrote: Fri Apr 23, 2021 9:44 am @ericbsd

Code: Select all

# pkg install upgrade -f automount
Updating GhostBSD repository catalogue...
GhostBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'upgrade' have been found in the repositories
pkg: No packages available to install matching '-f' have been found in the repositories
My fault, sorry

Code: Select all

 pkg upgrade -f automount