jahboater
Posts: 5680
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: ftp server - unable to upload files

Wed Jun 24, 2020 7:59 am

david_1234 wrote:
Wed Jun 24, 2020 6:37 am
I hav edone this at before

Code: Select all

sudo mkfs -t ext4 /dev/sda1
and someone here told me it's not OK
Who said that and why ?

This is the newer command, but its just the same in practice.

Code: Select all

sudo mkfs.ext4 /dev/sda1
Pi4 8GB running PIOS64

david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

Re: ftp server - unable to upload files

Wed Jun 24, 2020 9:26 am

this is what I'm getting

Code: Select all

pi@raspberrypi:~$ sudo mkfs.ext4 /dev/sda1
mke2fs 1.44.5 (15-Dec-2018)
/dev/sda1 contains a vfat file system labelled 'UBUNTU 16_0'
Proceed anyway? (y,N) y
/dev/sda1 is mounted; will not make a filesystem here!

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ftp server - unable to upload files

Wed Jun 24, 2020 9:51 am

Unmount the filesystem and try again. It cannot be formatted if it is in use.
Unreadable squiggle

david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

Re: ftp server - unable to upload files

Wed Jun 24, 2020 10:25 am

OK
now it'w working and I can change the permission - thanks

Code: Select all

pi@raspberrypi:~$ sudo chmod 777 -R /mnt/mydisk/ 
camera/     lost+found/ pi/         
pi@raspberrypi:~$ ls -ls /mnt/mydisk/camera/ 
total 4
4 drwxrwxrwx 2 pi pi 4096 Jun 24 13:20 ftp

I will start work on the ftp server and see if It's work as planed now

Thank you for the help!

User avatar
thagrol
Posts: 2961
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: ftp server - unable to upload files

Wed Jun 24, 2020 10:36 am

Setting aside all arguments about which file system is best try this:
  1. Plug in your USB stick
  2. Find the required information about it:
    1. Run

      Code: Select all

      sudo blkid
    2. Make a note of the TYPE, UUID, and PARTUUID e.g.
      • TYPE="vfat"
      • UUID="123456"
      • PARTUUID="654321"
  3. If TYPE="ntfs" run the following with while your Pi is able to access the internet:

    Code: Select all

    sudo apt update && sudo apt install -y ntfs-3g
  4. If TYPE="exfat" run the following with while your Pi is able to access the internet:

    Code: Select all

    sudo apt update && sudo apt install -y exfat-fuse exfat-utils
  5. Decide where you want it to appear in your file tree (i.e. decide on a mount point)
  6. Create the mount point:

    Code: Select all

    mkdir -p /path/to/mount_point
    You may need to prefix that with sudo depending on where your chosen mount point is located.
  7. Make a backup copy of /etc/fstab:

    Code: Select all

    sudo cp /etc/fstab /etc/fstab.bak
  8. Open /etc/fstab in your preferred text editor. You will need to be root or use "sudo" to do this.
  9. If you have a line from previous attempts to mount this device, remove it.
  10. Refering to the information gathered above add a new line/entry for the device, use either PARTUUID or UUID:
    • For vfat filesystem:

      Code: Select all

      PARTUUID=654321 /path/to/mount_point vfat defaults,nofail,noatime,umask=000 0 0
    • For exFAT filesystem:

      Code: Select all

      PARTUUID=654321 /path/to/mount_point exfat defaults,nofail,noatime,umask=000 0 0
    • For other filesystems:

      Code: Select all

      PARTUUID=654321 /path/to/mount_point TYPE defaults,nofail,noatime 0 0
      Where TYPE is the TYPE reported by blkid, above.
  11. Save and close /etc/fstab
  12. Reboot or run

    Code: Select all

    sudo mount -a
Edit: seems the OP fixed their issue while I was writig this post. Gonna leave it here as it may be useful to others.

Edit #2: added notes on exFAT
Last edited by thagrol on Wed Jun 24, 2020 2:48 pm, edited 1 time in total.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

Re: ftp server - unable to upload files

Wed Jun 24, 2020 2:03 pm

it's seem like a good guide for first time user!

great!

Return to “Beginners”