LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-15-2014, 02:57 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Cfdisk misuse crashing the filesystem.


Hi:

Bad use of cfdisk caused a big tree to be moved to a hidden directory. I had the partition table like this:
Code:
    sda1         Primary   ext2   [slack14-32]            20003.89 MB
    sda2         Primary   ntfs                           22940.31 MB
    sda3         Primary   swap                           4000 MB
    sda4         Extended
    sda5         Logical   vfat   [FREEDOS2012]           1000 MB
    sda6         Logical   ext2   [ALMACEN]             451773.51 MB
A DOS-like OS requires a primary partition. I made up my mind to use a swap file instead of sda3 and place FreeDOS in sda3. At the moment of writing the new partition table I had sda6 mounted, which is most probably the cause of the resulting mess. This a SATA hard disk seen as having 4KB sectors by fdisk. Always using cfdisk, I deleted the third partition (sda3) and made it vfat (type 0x0C, FAT32), suitable for FreeDOS. Then I deleted the 5th one (sda5) and updated the partition table. And then I saw ALMACEN was now sda5. But alas, ALMACEN was mounted during the update (not sure but most probably). Before the update (I keep calling it "update" for brevity; its the writing of the partition table) ALMACEN contained four directories:
Code:
CINE/
sma_/
soft/
Nonsoft/
But now, after the update, this is its contents:
Code:
root@server:~# ls -la /almacen/   
total 24
drwxr-xr-x  6 bill semoi 4096 2014-07-15 15:45 ./
drwxr-xr-x 25 root root  4096 2014-07-14 15:34 ../
drwx------  4 bill semoi 4096 2014-06-22 22:44 .Trash-1000/
drwxrwxrwx  4 bill semoi 4096 2014-05-30 13:57 CINE/
drwxrwxrwx 93 bill semoi 4096 2014-06-22 12:45 sma_/
drwxrwxrwx 74 bill semoi 4096 2014-06-19 23:54 soft/
root@server:~# ls -la /almacen/.Trash-1000/
total 16
drwx------ 4 bill semoi 4096 2014-06-22 22:44 ./
drwxr-xr-x 6 bill semoi 4096 2014-07-15 15:45 ../
drwx------ 4 bill semoi 4096 2014-07-15 15:45 files/
drwx------ 2 bill semoi 4096 2014-07-15 15:45 info/
root@server:~# ls -la /almacen/.Trash-1000/files/
total 932
drwx------  4 bill semoi   4096 2014-07-15 15:45 ./
drwx------  4 bill semoi   4096 2014-06-22 22:44 ../
drwxrwxrwx 43 bill semoi   4096 2014-03-23 12:51 Nonsoft/
drwxrwxrwx  2 bill semoi   4096 2014-03-23 12:51 THAYER/
-rw-rw-rw-  1 bill semoi   1164 2012-07-08 16:21 TRANS.TBL
-rw-r--r--  1 bill semoi 926721 2014-06-22 22:43 jsbach00widogoog_djvu.txt
root@server:~#
The old /almacen/Nonsoft directory had been transferred to the mysterious /almacen/.Trash-1000 directory. Who created it and who created the no less mysterious files and info directories? Is it possible that such a sophisticated rearrangement of the filesystem has been caused by messing with the partition table while ALMACEN (old sda6, new sda5) was mounted? No OS other than Slackware 14.0 could have messed with ALMACEN, which is ext2.

Slackware 14.0, 32 bits.

Last edited by stf92; 07-15-2014 at 03:02 PM.
 
Old 07-15-2014, 03:32 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,126

Rep: Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260
I doubt that cfdisk created jsbach00widogoog_djvu.txt. cfdisk is more into heavy metal than Bach.
Also, the dates indicate that these files have existed for a while, and were not created at the same time.
Somehow your files were moved to the trash Jun-22 and you have only noticed now because you are looking at other problems.

Here is a discussion of the Trash folder
http://www.linuxquestions.org/questi...1000-a-823077/
 
Old 07-15-2014, 09:09 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
"cfdisk is more into heavy metal than Bach.": I didn't know. You're right. .Trash-1000 was created long ago according to the time stamp. I hadn't noticed. And 1000 is the uid of the user running the GUI, which is me. So I was lucky that some program run in the GUI made that "backup" for me, because my last backup of the partition in question is two months old. Still, how could the system have erased the Nonsoft directory from /almacen, the mount point of the old /dev/sda6 (now /dev/sda5)? I'm pretty sure Nonsoft was in /almacen a couple of days ago. However, according to your link, it is more probable that Nonsoft was deleted at the same time when .Trash-1000 was created, Jun 22. I don't know what to think.

In any case, the GUI application who deleted Nonsoft could have prompted for confirmation before proceeding to erase a directory with hundreds of files in it! And unfortunately, linux does not keep a log file registering every command executed by the user with its dates. Otherwise, I could now know more about what happened. Thanks for your reply.
 
Old 07-16-2014, 02:20 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Rep: Reputation: Disabled
Quote:
Originally Posted by stf92 View Post
And unfortunately, linux does not keep a log file registering every command executed by the user with its dates.
No. But If you just want to remember what you did during a terminal session, script comes handy. Be careful, that could be used by the NSA or your boss as well. There's also history, of course.

Last edited by Didier Spaier; 07-16-2014 at 02:27 AM.
 
  


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
Cfdisk and NTFS filesystem options clifford227 Linux - Newbie 4 04-10-2011 12:13 PM
[SOLVED] trying to set filesystem type to ext3 in cfdisk bluegospel Slackware 3 06-22-2010 09:49 PM
misuse of mv command fedora_user Linux - Newbie 9 10-09-2008 08:10 AM
Hardware address misuse srikrishna097 Slackware 3 03-13-2007 03:59 PM
LXer: Considering the Misuse of Open Source LXer Syndicated Linux News 0 12-13-2005 01:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:13 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
Open Source Consulting | Domain Registration