LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2015, 10:46 AM   #1
kc5hwb
Member
 
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102

Rep: Reputation: 15
Borked Ubuntu with Putty SSH Cmd Line


I am not sure what happened here, and I find it oddly disturbing that a Putty session from Window could do this, but here is what I did -

I was attempting to open a ssh redirect session from Putty command line on my W7 work PC to my home PC running Ubuntu 14.04. I've done this before with the Putty GUI and had no issues at all, but this time I was using cmd line and it never did connect. I ran this command:
Code:
putty -ssh -D 1080 -P 22 domain.com
The Putty window opened but never connected. I tried twice and when it didn't connect, I gave up and went back to the GUI. I connected with the GUI just fine, but after connecting an SSH session to my Ubuntu server at home, I noticed it was acting odd.

Long story short: It was in a "read-only" mode, saying the file system was read-only. I couldn't run apt-get update or even create a new folder in my Home folder or desktop. I remotely rebooted the machine and it never came back online.

When I got home I checked it, and it told me that Ubuntu had found some errors, and was asking if I wanted to correct them. I said yes and it took a short while, but then finally let me log back in.

After this, the box is about 90-95% back to normal except for a couple of odd things that I don't understand.

The main issue is that my Samba shared drives are no longer working. The fstab file looks the same and can connect to other machines, but nothing can connect back to the Ubuntu box. The folder permissions are correct also. I have a CentOS7 box, a Fedora laptop and a W7 box - none of them can connect to my Ubuntu box. I only run Samba and connect with it, even from Linux boxes, just to make it simple (since Windows is stupid and can't use NFS) - this has always worked in the past. Now for the life of me, I can't figure out why nothing will connect.

Is there a logfile or trouble-shooter I could look at it see what happened? It should be in /var/log somewhere, but I don't know where to start. SSH? Samba? The entire filesystem was read-only for a short while, so is there a FS or System log in /var/log?

I am kinda confused on this one, any help is appreciated.
 
Old 05-15-2015, 10:16 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,052

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
Quote:
Originally Posted by kc5hwb View Post
I am not sure what happened here, and I find it oddly disturbing that a Putty session from Window could do this,
It didn't do anything. Don't confuse symptom with problem. Putty not connecting is a symptom ...
Quote:
When I got home I checked it, and it told me that Ubuntu had found some errors, and was asking if I wanted to correct them.
This is the problem.

No doubt Ubuntu has an option in fstab to remount ro when errors are found on the filesystem. Of course while the root is read only, no logs get written - unless you have /var mounted on its own partition. You reboot, you get the option to "fix" things. fsck fixes filesystems - your files may be collateral damage.
Have a look in lost+found to see if you have any file fragments that have been truncated. You may be able to figure out where they came from. Or not.
And not all files that are "fixed" have bits that wind up there. Some bits just disappear (multiple files linked to the same inode).

I never trust a system after an event like this. I wipe the filesystem and restore it in toto. Anything lost is gone - but the integrity of the filesystem can be assumed ok.
 
Old 05-15-2015, 11:17 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Running a SMART self-test on the disk after an event like this is also highly recommended. It's possible that your hard dribe is on its way out, in which case you'll need to back-up your critical files and replace the drive ASAP.

You can run "sudo smartctl -t long /dev/sda" to run an on-line non-destructive self-test and then "sudo smartctl -l selftest /dev/sda" to see the results. These examples assume your hard drive is in fact /dev/sda and that it has SMART capability (most drives manufactured within the last 5 years do).
 
Old 05-18-2015, 10:37 AM   #4
kc5hwb
Member
 
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
It didn't do anything. Don't confuse symptom with problem. Putty not connecting is a symptom ...This is the problem.
Well this all happened at the same time. The system was working fine and once I tried to connect with Putty, this issue started. I don't chalk that up to coincidence.

Quote:
Originally Posted by syg00 View Post
This is the problem.

No doubt Ubuntu has an option in fstab to remount ro when errors are found on the filesystem.
Except that it didn't reboot until I manually told it to, and this was after the filesystem had told me it was in a read-only state, which was directly after this Putty connection was attempted. The system didn't reboot on its own, I rebooted it as a result of the file system being read-only, and then the message of needing to check the file system came up on the screen. This was the 1 and only reboot that was done.

Quote:
Running a SMART self-test on the disk after an event like this is also highly recommended. It's possible that your hard dribe is on its way out, in which case you'll need to back-up your critical files and replace the drive ASAP.
It is possible but this HDD is new. Maybe 2 months old. But I always have a backup anyway. I don't believe this to be a hardware issue, though.

I run this smartctl command and see what the results are.

Thanks to you both for the replies.
 
Old 05-18-2015, 10:42 AM   #5
kc5hwb
Member
 
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by btmiller View Post
Running a SMART self-test on the disk after an event like this is also highly recommended. It's possible that your hard dribe is on its way out, in which case you'll need to back-up your critical files and replace the drive ASAP.

You can run "sudo smartctl -t long /dev/sda" to run an on-line non-destructive self-test and then "sudo smartctl -l selftest /dev/sda" to see the results. These examples assume your hard drive is in fact /dev/sda and that it has SMART capability (most drives manufactured within the last 5 years do).
When I try to run this command, it says "smartctl: command not found" This is Ubuntu 14.04

I will say that over the weekend, somehow, SSH started working again. I am able to connect to the box now, but the Samba shares still appear to be broken.
 
Old 05-18-2015, 11:12 AM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,362

Rep: Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004
Quote:
Originally Posted by kc5hwb View Post
Well this all happened at the same time. The system was working fine and once I tried to connect with Putty, this issue started. I don't chalk that up to coincidence.
I highly doubt it all started at the same time. Likely the hard drive had a problem and the system remounted it in RO mode long before you tried to connect with Putty. As syg00 said, Putty not connecting was only a symptom of a problem that had already occurred, that was just the first time you saw it.
 
Old 05-18-2015, 11:46 AM   #7
kc5hwb
Member
 
Registered: Jun 2001
Location: Grapevine, Texas
Distribution: Ubuntu 14.04, CentOS 7
Posts: 102

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by suicidaleggroll View Post
I highly doubt it all started at the same time. Likely the hard drive had a problem and the system remounted it in RO mode long before you tried to connect with Putty. As syg00 said, Putty not connecting was only a symptom of a problem that had already occurred, that was just the first time you saw it.
I was connected via SSH to this box all day, running updates and performing tasks. This happened at the same time I tried to connect with Putty cmd line.

I hear what you guys are saying, and I am not tell you that you are wrong, but the evidence suggests it was caused by Putty Cmd Line. Everything with the connection on the box worked fine up until that point, and I was using it regularly all day up until then also.

Regardless of the cause, my main question is what can I run or check to attempt a repair of the issue? The smartctl cmd doesn't seem to work.
 
Old 05-18-2015, 01:05 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,362

Rep: Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004
Quote:
Originally Posted by kc5hwb View Post
Regardless of the cause, my main question is what can I run or check to attempt a repair of the issue? The smartctl cmd doesn't seem to work.
Install smartmontools
 
  


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
[SOLVED] Selecting multiple line in putty ssh fraksipon Linux - Newbie 1 01-10-2015 08:57 AM
Ubuntu Igel cmd line to present windows login dreynolds1968 Linux - Newbie 0 11-11-2014 04:44 PM
Help with Ubuntu server remote ssh and local network ssh issues using putty. scottpops Linux - Server 8 05-17-2012 06:07 PM
Issue sg_modes cmd at cmd line, want to see the cmd in binary form NuUser Linux - Newbie 1 03-28-2012 09:08 AM
How to start SSH server from cmd line? kc5hwb Ubuntu 5 04-11-2007 07:27 PM


All times are GMT -5. The time now is 11:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration