LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 12-07-2012, 10:05 PM   #1
AngryAngry
Member
 
Registered: Jan 2011
Posts: 60

Rep: Reputation: 0
Weird happenings with memstick & files


Slackware 13.37, XFCE windows
I only keep my data on memory stick, and rarely restart - simply unmount and suspend. Sometimes I have many documents open and suspend then sneakily remove my memory stick then reattach before waking my computer.

I have noticed my memory stick sometimes auto remount after I have unmounted it instead of mounting as KINGSTON, it mounts as KINGSTON_

I have also noticed with some .txt files (which I have not accessed recently), an identical copy appears in Thunar file manager as .txt~

I'm certain you will scold me for my non-shutdown and stealth memstick removals, and will have the answers I seek.

Last edited by AngryAngry; 12-07-2012 at 10:20 PM.
 
Old 12-08-2012, 06:02 AM   #2
marbangens
Member
 
Registered: Aug 2012
Location: sweden
Distribution: Slackware, Fedora
Posts: 79

Rep: Reputation: Disabled
reproduce that and give less /var/log/syslog | tail -100
 
Old 12-08-2012, 06:04 AM   #3
marbangens
Member
 
Registered: Aug 2012
Location: sweden
Distribution: Slackware, Fedora
Posts: 79

Rep: Reputation: Disabled
Quote:
Originally Posted by AngryAngry View Post
I have also noticed with some .txt files (which I have not accessed recently), an identical copy appears in Thunar file manager as .txt~
that is a backup file that is automatically created by many popular text editors

Last edited by marbangens; 12-08-2012 at 06:06 AM.
 
Old 12-08-2012, 06:43 AM   #4
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I hope you don't keep any important data on a memory stick = flash media.
 
Old 12-08-2012, 12:17 PM   #5
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware64 14.1
Posts: 397

Rep: Reputation: 153Reputation: 153
Quote:
Originally Posted by AngryAngry View Post
I'm certain you will scold me for my non-shutdown and stealth memstick removals, and will have the answers I seek.

Well, I found this bit of information in /usr/src/linux/Documentation/power/swsusp.txt, it might be related to your problem, or not...

Code:
Q: Is this true that if I have a mounted filesystem on a USB device and
I suspend to disk, I can lose data unless the filesystem has been mounted
with "sync"?

A: That's right ... if you disconnect that device, you may lose data.
In fact, even with "-o sync" you can lose data if your programs have
information in buffers they haven't written out to a disk you disconnect,
or if you disconnect before the device finished saving data you wrote.

Software suspend normally powers down USB controllers, which is equivalent
to disconnecting all USB devices attached to your system.

Your system might well support low-power modes for its USB controllers
while the system is asleep, maintaining the connection, using true sleep
modes like "suspend-to-RAM" or "standby".  (Don't write "disk" to the
/sys/power/state file; write "standby" or "mem".)  We've not seen any
hardware that can use these modes through software suspend, although in
theory some systems might support "platform" modes that won't break the
USB connections.

Remember that it's always a bad idea to unplug a disk drive containing a
mounted filesystem.  That's true even when your system is asleep!  The
safest thing is to unmount all filesystems on removable media (such USB,
Firewire, CompactFlash, MMC, external SATA, or even IDE hotplug bays)
before suspending; then remount them after resuming.

There is a work-around for this problem.  For more information, see
Documentation/usb/persist.txt.
 
Old 12-08-2012, 11:11 PM   #6
AngryAngry
Member
 
Registered: Jan 2011
Posts: 60

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Diantre View Post
Well, I found this bit of information in /usr/src/linux/Documentation/power/swsusp.txt, it might be related to your problem, or not...

Code:
Q: Is this true that if I have a mounted filesystem on a USB device and
I suspend to disk, I can lose data unless the filesystem has been mounted
with "sync"?

A: That's right ... if you disconnect that device, you may lose data.
In fact, even with "-o sync" you can lose data if your programs have
information in buffers they haven't written out to a disk you disconnect,
or if you disconnect before the device finished saving data you wrote.

Software suspend normally powers down USB controllers, which is equivalent
to disconnecting all USB devices attached to your system.

Your system might well support low-power modes for its USB controllers
while the system is asleep, maintaining the connection, using true sleep
modes like "suspend-to-RAM" or "standby".  (Don't write "disk" to the
/sys/power/state file; write "standby" or "mem".)  We've not seen any
hardware that can use these modes through software suspend, although in
theory some systems might support "platform" modes that won't break the
USB connections.

Remember that it's always a bad idea to unplug a disk drive containing a
mounted filesystem.  That's true even when your system is asleep!  The
safest thing is to unmount all filesystems on removable media (such USB,
Firewire, CompactFlash, MMC, external SATA, or even IDE hotplug bays)
before suspending; then remount them after resuming.

There is a work-around for this problem.  For more information, see
Documentation/usb/persist.txt.
Happily I haven't noticed any data loss so far. But yes I should probably stop doing it (cautiously scared now). I keep ALL my important data on multiple memory sticks, and one HDD copy.
I'm more worried about the constant mounting & unmounting without restarting linux - I believe it has been 2 months so far.

Last edited by AngryAngry; 12-08-2012 at 11:12 PM.
 
Old 12-10-2012, 08:39 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Member Response

Hi,
Quote:
Originally Posted by AngryAngry View Post
Happily I haven't noticed any data loss so far. But yes I should probably stop doing it (cautiously scared now). I keep ALL my important data on multiple memory sticks, and one HDD copy.
I'm more worried about the constant mounting & unmounting without restarting linux - I believe it has been 2 months so far.
Look at: (Linux is Not Windows) 'which refers to the GNU/Linux OS and various Free & Open-Source Software (FOSS) projects under the catch-all name of "Linux". It scans better.' + Great Article

Gnu/Linux reboots are not always necessary, especially when you are using a properly setup Slackware based system.

Sad that a lot of new users do not know or are referenced to good admin techniques or procedures;
Quote:
Just a few links to aid you to gaining some understanding;



1 Linux Documentation Project
2 Rute Tutorial & Exposition
3 Linux Command Guide
4 Bash Beginners Guide
5 Bash Reference Manual
6 Advanced Bash-Scripting Guide
7 Linux Newbie Admin Guide
8 LinuxSelfHelp
9 Utimate Linux Newbie Guide

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
Once your system is properly setup and you as admin learn to execute or perform good maintenance then you should not worry. Learn to mount & dismount cleanly then you should not cause issues with either the flash or system. Hopefully you will learn not to worry about the system when used properly.
HTH!
 
Old 12-11-2012, 08:23 PM   #8
AngryAngry
Member
 
Registered: Jan 2011
Posts: 60

Original Poster
Rep: Reputation: 0
Thanks

I do unmount, but I have noticed KINGSTON is still there, and I can even open an empty Thunar window! That is why KINGSTON_ is being mounted - not sure that this solves anything.

I tried logging out of XFCE but that didn't help.

Thank you for the advice, I will definitely investigate those links.
 
Old 12-11-2012, 09:15 PM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Member Response

Hi,

From the cli as root from console issue, 'sync' then 'umount /dev/your_device', be sure to replace 'your_device with the acutal device. You should see some activity for sync and the umount should allow you to remove device. Issue 'mount' to see what is still mount. You can always see what is mounted by using 'mount' command.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
slack: usb memstick howto? nadroj Linux - Hardware 10 10-12-2005 11:09 PM
Bootable USB memstick... Bigun Linux - Hardware 2 08-30-2004 03:06 PM
Unable to mount USB memstick in RHL9 j_harishankar Linux - Hardware 4 05-23-2004 08:55 AM
weird C happenings ...... purpleburple Programming 4 08-19-2002 01:09 AM
weird lib happenings. da Perp Linux - Newbie 0 12-21-2001 10:08 AM


All times are GMT -5. The time now is 04:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration