Can't write to USB flash drive

Need support for GhostBSD. Ask here if your question does not fit elsewhere.
User avatar
security_lover
Posts: 69
Joined: Thu Apr 22, 2021 9:54 am

Can't write to USB flash drive

Post 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 ?
I am paranoid about security !
User avatar
NevilleGoddard
Developer
Posts: 517
Joined: Thu Dec 22, 2016 10:30 pm
Location: Japan

Re: Can't write to USB flash drive

Post 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
User avatar
NevilleGoddard
Developer
Posts: 517
Joined: Thu Dec 22, 2016 10:30 pm
Location: Japan

Re: Can't write to USB flash drive

Post by NevilleGoddard »

The USB should automatically mount
User avatar
security_lover
Posts: 69
Joined: Thu Apr 22, 2021 9:54 am

Re: Can't write to USB flash drive

Post 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.
I am paranoid about security !
User avatar
security_lover
Posts: 69
Joined: Thu Apr 22, 2021 9:54 am

Re: Can't write to USB flash drive

Post 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
I am paranoid about security !
User avatar
security_lover
Posts: 69
Joined: Thu Apr 22, 2021 9:54 am

Re: Can't write to USB flash drive

Post 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.
I am paranoid about security !
User avatar
ericbsd
Developer
Posts: 2052
Joined: Mon Nov 19, 2012 7:54 pm

Re: Can't write to USB flash drive

Post 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.
User avatar
security_lover
Posts: 69
Joined: Thu Apr 22, 2021 9:54 am

Re: Can't write to USB flash drive

Post 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
I am paranoid about security !
User avatar
security_lover
Posts: 69
Joined: Thu Apr 22, 2021 9:54 am

Re: Can't write to USB flash drive

Post by security_lover »

I have installed using this iso >>> GhostBSD-21.01.20.iso
I am paranoid about security !
User avatar
ericbsd
Developer
Posts: 2052
Joined: Mon Nov 19, 2012 7:54 pm

Re: Can't write to USB flash drive

Post 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
Post Reply