Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17
I cannot beleive this happened. I was copying some files in graphical mode, from one directory to /var/html/www/ and the curser jumped and picked up the var directory and dropped ...
  1. #1
    Just Joined!
    Join Date
    Jul 2007
    Posts
    9

    Deleted /VAR directory

    I cannot beleive this happened. I was copying some files in graphical mode, from one directory to /var/html/www/ and the curser jumped and picked up the var directory and dropped it somewhere. I suspect the var directory was deleted. I was in root at the time so no warning messages.
    I looked in the filesystem and sure enough var had gone. I then tried to find it with the file search, then looked back in the file system and var had reappeared but with just one log file in it

    I logged out out root, and the graphical mode could then not be restarted.

    I have left the system alone as it is still serving files, but what is going to happen when I reboot ? I suspect it is going to crash and I willl have to reinstall the Centos operating system again.

    I have the files backed up for the data on the server was holding, but not the filesystem itself (won't do that again!)

    I was half hoping that the var files could be rewritten, but I surely would need to reboot this server now.

    Surely by the accident you learn by mistakes but is a reinstal the only way out?

    Thanks in advance if anyone can help?

  2. #2
    Trusted Penguin Dapper Dan's Avatar
    Join Date
    Oct 2004
    Location
    The Sovereign State of South Carolina
    Posts
    4,562
    Don't feel like the Lone Ranger...

    Link

    Wish I could help more...
    Linux Mint + IceWM Registered:#371367 New Members: click here

  3. #3
    Just Joined!
    Join Date
    Jul 2007
    Posts
    9
    Thanks for that, at least someone else has been there. I have been kicking arse all afternoon ( Mine)

    I tried a search but that link didn't turn up.
    I'll try a reboot of the 1st install disk when the inevitable crash occurs.

  4. #4
    Just Joined!
    Join Date
    Apr 2007
    Posts
    47
    Quote Originally Posted by pilotfred View Post
    I then tried to find it with the file search,
    If you deleted it, it should be in the root's trashcan. You might also put it in an other folder by drag and drop. Use your search tool again. Even if it were "permanently deleted" you can recover it. Permanent deletion deletes with one pass and there are tools which can recover even more passes (layers).

  5. #5
    Just Joined!
    Join Date
    Jul 2007
    Posts
    9
    Thanks, I think I did a second stupid thing by logging out as root so I cannot get back in to do a re-search.
    I cannot even get into terminal as there is an error message 'bad close and cannot install ' ( haven't got the precise message at the moment ) but a black screen and flashing curser that will not respond to entry, escape or delete.

    Wish I could get back in it, or the terminal ?

  6. #6
    Just Joined!
    Join Date
    Apr 2007
    Posts
    47
    Quote Originally Posted by pilotfred View Post
    Thanks, I think I did a second stupid thing by logging out as root so I cannot get back in to do a re-search.
    I cannot even get into terminal as there is an error message 'bad close and cannot install ' ( haven't got the precise message at the moment ) but a black screen and flashing curser that will not respond to entry, escape or delete.

    Wish I could get back in it, or the terminal ?
    Very strange. What is your distro? You must find a way to get admin rights in order to put things in their place...

  7. #7
    Just Joined!
    Join Date
    Jul 2007
    Posts
    9
    I am using Centos OS on a Dell 2600 power edge box, been nice and stable (Till now)

    What would be a good command to get out of the black error screen without rebooting?

  8. #8
    Trusted Penguin Dapper Dan's Avatar
    Join Date
    Oct 2004
    Location
    The Sovereign State of South Carolina
    Posts
    4,562
    If it were me, and I thought my var directory was just hidden somewhere, I think I'd boot a live cd on that box, mount the partition where your root directory is and search for it that way. For instance, if your root directory is on hda1, (as su from the live cd):
    Code:
    mkdir /mnt/hda1
    Code:
    mount /dev/hda1 /mnt/hda1
    Manually look for it, or if the live cd you use allows for it do:
    Code:
    updatedb
    Then:
    Code:
    locate var
    If it can be done that way, /var will be located but that will be part of the live cd. Your var is going to be somewhere else in /mnt/hda1.
    Linux Mint + IceWM Registered:#371367 New Members: click here

  9. #9
    Just Joined!
    Join Date
    Jul 2007
    Posts
    9
    I wish, I wish I had not logged out of gnome as root, Panick I suppose, in hindsight var is probably been dropped somewhere not deleted.

    I'll try your commands with the install Cd 1 and see if I can find it.

    Many thanks

  10. #10
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Right. Since you were in graphical mode, delete doesn't mean delete. It actually moves it to the trash. So try checking (using Dapper Dan's example) /mnt/hda1/root/.Trash. If it's not there, then use the locate method, or you can try:
    Code:
    find /mnt/hda1 -type d -name var
    This will look for a directory called 'var' in the tree starting at /mnt/hda1. It will take a while to run, but might find it if it was just accidentally moved.

    As a sidenote, this is an excellent example of why you never login as the root user or use root in graphical mode :-p.
    DISTRO=Arch
    Registered Linux User #388732

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...