nesswaw
Posts: 12
Joined: Tue Oct 03, 2017 3:24 pm

[SOLVED] Raspbian: file is not really deleted in usb drive

Thu Nov 09, 2017 4:16 pm

Hello,

I have a Raspbian Stretch on RPI model 1
I have created a script that delete files on a USB flash drive => it's work perfectly on RPI 1

Now, I re-installed Strtech on RPI 3, config script, etc. => But deleting files on the key is random :shock: :shock: :shock:

When I make an "ls" in the dir, it's empty.
I insert the key on a Windows computer and find my file :o :shock:

I don't understand anything, how is that possible?

And the problem is random, it works on three times out of three.

An idea?

Thanks
Last edited by nesswaw on Mon Nov 13, 2017 9:51 am, edited 1 time in total.

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Raspbian: file is not really deleted in usb drive

Thu Nov 09, 2017 4:19 pm

the usb has gone read only , create a file under windows - can you see it on the raspberry ?
or even back on windows after a eject and reload
or you are not mounting the drive right
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5644
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Raspbian: file is not really deleted in usb drive

Thu Nov 09, 2017 5:56 pm

nesswaw wrote: Hello,
I have a Raspbian Stretch on RPI model 1
...
Is that a really early B1 with the (extra) USB polyfuses? IIRC, something similar happened with mine (raspiblack**) running a UB-stick-based MoinMoin Wiki. I was able to read and clone/copy the Wiki to a new USB stick and run it on a later Pi. (Since then, it's been cloned again and is now run on my P2B. My "Raspberry Pi webpages" are an "export" of said Wiki). Said polyfuses were "removed" because of various problems discovered "back then".
Trev.
** http://www.cpmspectrepi.uk/raspberry_pi ... uePis.html
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

nesswaw
Posts: 12
Joined: Tue Oct 03, 2017 3:24 pm

Re: Raspbian: file is not really deleted in usb drive

Fri Nov 10, 2017 9:55 am

Hello,

I set the RPI3 SD card to RPI1 and everything works.

There is indeed a hardware problem with the RPI3...

What can we do about it? Or I have to do a special mount command?

How to solve the problem with these polyfuses?

Thank you for your help

PS: Details RPI

- RPI1 => Revision 000E => Model B Revision 2.0 512MB, (Sony)
- RPI3 => Revision a02082 => 3 Model B 1Go

nesswaw
Posts: 12
Joined: Tue Oct 03, 2017 3:24 pm

Re: Raspbian: file is not really deleted in usb drive

Fri Nov 10, 2017 2:53 pm

After multiple tests, adding an umount command directly after copying the files would solve the problem?? :?

How do you feel about that?

Thanks

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5644
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Raspbian: file is not really deleted in usb drive

Fri Nov 10, 2017 4:47 pm

nesswaw wrote: ...
PS: Details RPI
- RPI1 => Revision 000E => Model B Revision 2.0 512MB, (Sony)
- RPI3 => Revision a02082 => 3 Model B 1Go
The "512Mb etc." implies that RP1 is not a B1 (256Mb + USB polyfuses) but a B2 so your issue appears not to be related to the issue I had (which I associated with the USB polyfuses because of various, other problems, reported, probably due to partial fuse activation.) - "red herring", unfortunately.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
Paeryn
Posts: 2986
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Raspbian: file is not really deleted in usb drive

Fri Nov 10, 2017 5:25 pm

nesswaw wrote:
Fri Nov 10, 2017 2:53 pm
After multiple tests, adding an umount command directly after copying the files would solve the problem?? :?

How do you feel about that?

Thanks
Beforehand did you ever unmount the USB stick before removing it (either from the command line or the eject option from the GUI)? If not then there is always a chance that data hasn't been sent to the stick, the system generally buffers writes rather than doing them immediately (it's quicker to update an in memory block and can save writing the same blocks multiple times at the expense of loosing changes if you don't unmount before removing).
She who travels light — forgot something.

nesswaw
Posts: 12
Joined: Tue Oct 03, 2017 3:24 pm

Re: Raspbian: file is not really deleted in usb drive

Mon Nov 13, 2017 9:51 am

Hello,


On RPI1, it works:

1) RM command on usb drive
2) Physically removed usb drive
3) Umount command (via script and rules udev)

But it does not work on RPI3

On RPI3, it works:

1) RM command on usb drive
2) Umount command (via script)
3) Physically removed usb drive

I can close this topic, the problem is solved.

Thank you for your help ;)

Return to “Advanced users”