Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Avoiding data loss after removing NTFS usb without unmounting.

    Scheduled Pinned Locked Moved General pfSense Questions
    10 Posts 5 Posters 958 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      alivdel
      last edited by

      I have a Hardware with two USB plugs and pfSense on it. I want to configure one of them for FAT32 and another for NTFS.
      fstab should be configured in that way that the USBs been mounted automatically.

      I added this two lines to the /etc/fstab:

      /dev/da1s1  /mnt/usb1 ntfs mountprog=/usr/local/bin/ntfs-3g,rw,noauto,late 0   0        
      /dev/da2s1  /mnt/usb2 msdosfs rw,noauto,-m=777,-M=777                      0   0 
      

      Now they will be automatically mounted if I insert proper USB but after removing them there is data loss by NTFS Format USB (FAT32 is ok).
      how can i force NTFS usb to be written immidiately.
      Can anybody help me to solve this problem? thanks.

      1 Reply Last reply Reply Quote 0
      • H
        heper
        last edited by

        without unmounting chance of corruption is always there. doesn't matter what filesystem or even what type of operating system.

        also: why?

        A 1 Reply Last reply Reply Quote 0
        • A
          alivdel @heper
          last edited by alivdel

          @heper
          yes i know about Chance of corruption, but also want to minimize possibility of data loss if someone forget to unmount the usb.
          i searched in the net, there is some options for example "sync", i tried that but same result. All data are lost on NTFS without unmounting.

          1 Reply Last reply Reply Quote 0
          • JKnottJ
            JKnott
            last edited by

            @alivdel said in Avoiding data loss after removing NTFS usb without unmounting.:

            how can i force NTFS usb to be written immidiately

            I believe the sync command should do that. Why do you want both FAT32 and NTFS?

            PfSense running on Qotom mini PC
            i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
            UniFi AC-Lite access point

            I haven't lost my mind. It's around here...somewhere...

            A 1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              Removing a filesystem without unmounting it is always going to be a bad idea.
              But more generally, as others have said, why are you doing this on pfSense?

              Steve

              A 1 Reply Last reply Reply Quote 0
              • A
                alivdel @JKnott
                last edited by

                @jknott
                i tried sync flag, it works on FAT32 but not on NTFS.

                1 Reply Last reply Reply Quote 0
                • A
                  alivdel @stephenw10
                  last edited by

                  @stephenw10
                  i want to use usb as DMZ and idea is to download and upload from/on usb.
                  and as i said i'm aware of problems happen if filesystem is removed without unmounting. it's only to minimize data loss in case that happened.

                  GrimsonG 1 Reply Last reply Reply Quote 0
                  • GrimsonG
                    Grimson Banned @alivdel
                    last edited by Grimson

                    @alivdel said in Avoiding data loss after removing NTFS usb without unmounting.:

                    i want to use usb as DMZ and idea is to download and upload from/on usb.

                    What? You can put a networking device or VM into a DMZ. You can't use an USB stick as a DMZ.

                    Also pfSense is a firewall, not a p2p server.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      alivdel @Grimson
                      last edited by

                      @grimson
                      thanks for your extra Information but do you have any idea about my main question?

                      1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        Don't use NTFS maybe?

                        Not at all clear on what you're doing here though.

                        Steve

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.