Announcement

Collapse
No announcement yet.

HDD messed up, corrupted linux files, missing /home folder

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HDD messed up, corrupted linux files, missing /home folder

    old intel-based desktop, two HDD, 1 GB ram, dualboot XP+kubuntu 32 bit (latest version), no CD drive.
    today i was surfing on the kubuntu system when suddenly the second hard drive (the one kubuntu is on) started messing up. suddenly the system told me it can't write on the hard drive (seemed to read from it just fine, despite all of the warning messages). i restarted back to windows, which worked just fine (for a 7 year old OS with a lot of junk). a few hours later, when i rebooted back to kubuntu i got a message saying there's a corrupt file system and i should repair it. i rebooted to safe mode and it gave me the same message, so i did "ctrl+D" (i think) to continue and did a file system scan from the menu. it didn't give me any indication that there was something wrong with the file system but as i exited it told me it can't write on the hard drive or that the files are read-only. i tried to log in normally (with the GUI, ignoring the previous error messages with ctrl+D) and the system said it can't find "home" folder and i can't log in because of that. on the console i did "dir" on root folder and it showed a "home" folder, but after doing "cd home" and in it "dir" it showed blank. nothing was in there.
    the HDD with the linux also has a FAT32 partition which i easily access from the XP, both read and write, so i know there's no problem with the WHOLE hard drive.
    what to do??

    note, as written in the beginning, i don't have a CD drive so i can't reinstall.

    #2
    Re: HDD messed up, corrupted linux files, missing /home folder

    Me being more of a hardware guy than anything else, sounds like you have a problem with the kubuntu hard drive. You can read a drive just fine sometimes and still not be able to write to it. Thats fairly common when a hdd is crashing. First thing to do, when you turn on system and it is posting, go into BIOS. Find your S.M.A.R.T. utilities and check that drive. (If you have the utilities which you should). If not, go to your hard drive manufacturers site and download their disk utilities. They should have one for checking the drive. Do a full check, and also the option for 'writing zeros to disk'. That will tell you the drives condition. You may end up installing a new drive, then copy or ghost the system to new drive, and then run the kubuntu file check. btw, you can download and check the drive from your windows drive, you may need to do that anyway as a lot of manufacturers still don't have many things for Linux. Or, get the DOS based versions. Hope this helps you

    Comment


      #3
      Re: HDD messed up, corrupted linux files, missing /home folder

      thanks, but as i stated that hard drive has a FAT32 partition as well and that works just fine under windows. i mean i can both read and write. the current problem seems to be only in the linux partitions of the hard drive.

      as for the S.M.A.R.T. well, i don't know if my BIOS has it, being about 7 years old and all. i looked in it earlier to see if the bios recognizes the drive (no problems there) but i don't recall seeing such an option. i'll try again later.

      Comment


        #4
        Re: HDD messed up, corrupted linux files, missing /home folder

        i don't have a CD drive so i can't reinstall.
        It is not true, you can prepare install usb in Windows using program unetbootin, which you can download from Internet.

        You can try to install ext2 driver in Windows, which normally allows you to read and write to ext3 partitions from Windows, but in your case I am not sure if it helps. You can download the driver Ext2Fsd-0.46a.exe from Internet.

        I would try to install HDDScan_v31.zip in Windows to see, what is going on with the disk.
        Kubuntu 16.04 on two computers and Kubuntu 17.04 on DELL Latitude 13

        Comment


          #5
          Re: HDD messed up, corrupted linux files, missing /home folder

          More problems already. Before suggesting anything it might be a good idea to post the contents of you /etc/fstab file so we understand your disk layout. Usually running fsck on the partition will fix most errors.

          You can also install SMART tools from the repository. (sudo aptitude install smartmontools)

          http://smartmontools.sourceforge.net/doc.html

          UK

          linux && bash = "the future"

          Comment


            #6
            Re: HDD messed up, corrupted linux files, missing /home folder

            before doing the above just let me say that i have a laptop with a different linux distro and i could, in theory, do a USB flash drive thing there. the problem is that my flash drive isn't bootable (or at least that's what i understood).
            how can i see the contents of the fstab file? sorry, i'm a GUI guy, my console days went when win 98 came out and replaced DOS.

            Comment


              #7
              Re: HDD messed up, corrupted linux files, missing /home folder

              Code:
              cat /etc/fstab

              Comment


                #8
                Re: HDD messed up, corrupted linux files, missing /home folder

                Originally posted by swefal

                sorry, i'm a GUI guy, my console days went when win 98 came out and replaced DOS.
                Kinda-sorta GUI way:

                Alt-F2 "kate /etc/fstab"

                Cut & paste what kate shows.

                Comment


                  #9
                  Re: HDD messed up, corrupted linux files, missing /home folder

                  thanks skunk.

                  dibl, i can't access the GUI.

                  Comment


                    #10
                    Re: HDD messed up, corrupted linux files, missing /home folder

                    since i had to copy by-hand, i just took the interesting bits of fstab:

                    root and home partitions are ext4, swap is naturally, sw.

                    root: /dev/sdb5 ; mountpoint: realtime, errors=remount-ro ; dump: 0 ; pass 1 (if i remember correctly it was 1)
                    swap: /dev/sdb6 ; mountpoint: realtime ; dump: 0 ; pass: 0
                    home: /dev/sdb7 ; mountpoint: realtime ; dump: 0 ; pass: 2

                    i couldn't get the network working so i couldn't install smart tools directly. i tried to do fsck and got a big warning message that doing it on a mounted drive (/dev/sdb5) may cause all sorts of terrible things so naturally, i said no.

                    and UK, didn't you say the fun in linux wasn't using it but solving the problems? well, looks like i provide you with hours of enjoyment

                    Comment


                      #11
                      Re: HDD messed up, corrupted linux files, missing /home folder

                      Nice one, but I hope others jump on this one too. Yeah, I enjoy the challenge of solving problems. It keeps the skills polished to hang out here and help others. I see you have a root and home partition. To start, let's check your /home partition...

                      1. sudo umount /dev/sdb7
                      2. sudo fsck /dev/sdb7

                      Post your results as usual.


                      linux && bash = "the future"

                      Comment


                        #12
                        Re: HDD messed up, corrupted linux files, missing /home folder

                        Originally posted by swefal

                        dibl, i can't access the GUI.

                        Oooooooooops.

                        Hmmm, can't boot a Live CD to run e2fsck because no optical drive.

                        This is like a Linux test, huh? Let me guess, you've never made a bootable USB stick either (which would come in very handy right about now ....).

                        I don't believe there's no /home directory. When you boot Recovery Mode, I think you're logged in automatically as root, right? Do
                        Code:
                        pwd
                        and what do you see? Do
                        Code:
                        cd /home
                        and then
                        Code:
                        pwd
                        -- now what do you see?

                        Well, I suppose I could work on the GUI angle, but in the end, your hard drive needs a fsck. With no optical drive, I'm not sure how you're going to do that.

                        Anyway, boot Recovery Mode, and try the "Fix X" option on the recovery menu. If that doesn't help, from the root prompt ("#") issue dpkg-reconfigure xserver-xorg and then restart the system with
                        Code:
                        shutdown -r now

                        Comment


                          #13
                          Re: HDD messed up, corrupted linux files, missing /home folder

                          pwd: /root
                          pwd [home]: /home

                          yes, i'm logged in as root, and as such my /home folder is empty. i can't log in as the normal user since it claims it can't access certain files and it's read-only.

                          i don't think there's a problem with x since the problem isn't getting into the GUI rather than not being able to go past the GUI's log-in screen since it can't log in as the normal user.

                          i can't do copy/paste to the error messages i receive but i can write specific ones down (you tell me which and where) and they all either say they can't locate the /home folder and thus can't log-in (in the GUI login screen) or say that the files are corrupted and read-only (console messages while booting the system).

                          Comment


                            #14
                            Re: HDD messed up, corrupted linux files, missing /home folder

                            from the console do

                            Code:
                            man adduser
                            read then add a diferent user with these groups

                            adm dialout cdrom plugdev lpadmin admin sambashare
                            and log in as the new user

                            VINNY
                            i7 4core HT 8MB L3 2.9GHz
                            16GB RAM
                            Nvidia GTX 860M 4GB RAM 1152 cuda cores

                            Comment


                              #15
                              Re: HDD messed up, corrupted linux files, missing /home folder

                              Originally posted by swefal
                              pwd: /root
                              pwd [home]: /home

                              yes, i'm logged in as root, and as such my /home folder is empty. i can't log in as the normal user since it claims it can't access certain files and it's read-only.
                              OK, if you're logging into Recovery Console as root, then here's something to try.

                              There are two "hidden" files in your user's home folder than pick up root privileges when you muck in the user's folder while you're logged in as root. These two files are .ICEauthority and .Xauthority. There could be other problem files in your user folder -- I dunno. But, since it's all buggered up anyway, try this as root (assuming the user's name is "swefal"):
                              Code:
                              mv /home/swefal/.ICEauthority /home/swefal/.ICEauthority_old
                              mv /home/swefal/.Xauthoriy /home/swefal/.Xauthority_old
                              then, still as root:

                              Code:
                              /etc/init.d/kdm stop
                              then Ctrl-Alt F3 and log in there as the user, and issue
                              Code:
                               startx
                              I'll cross my fingers.


                              p.s. none of this does anything for your hard drive -- if it needs fsck'd, then it still does.

                              Comment

                              Working...
                              X