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

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

    thanks one and all.
    first, my user name is, naturally, not swefal, but in any case i assume the hard drive DOES need fsck, the question is this: when i tried to do it a couple of days ago it gave me a warning that continuing may destroy the partition (since it's mounted). should i or shouldn't i do that? my intention was to try and fix the file system and then, if possible, fix the corrupted files so i can get my old /home back, with (at least most of) my data.
    what do you guys say? any chance of that happening? btw, i DID try making a bootable USB flash drive but after making it (with a HP software recommended to me in this forum) i got a message from my bios that it's not bootable. after looking online a bit i found that only SOME flash drives can be made bootable, and i guess mine isn't one. i DO, however, have another linux distro on another computer and it might be possible (just throwing a thought here) to do something with it, get into the root recovery console, then to the USB drive and do fsck from there.
    again, i have no idea how these things work, i'm just throwing ideas into the air, hoping one of them might evolve to develop wings and fly.

    Comment


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

      Originally posted by swefal

      should i or shouldn't i do that?
      No. I think your data are salvageable, but not if you do that.


      i DO, however, have another linux distro on another computer and it might be possible (just throwing a thought here) to do something with it
      Aha!

      Yes, -- can you physically remove the problem drive from its computer? If so, can you connect it as a second drive to the good computer? If so, you're good to go. If you can remove it from the broken system, but can't connect it to the other one ('cause it's a lappy or something), then if you can stand the wait, you want to spend $20 and get one of these:

      http://www.tigerdirect.com/applicati...29300&csid=_21

      There are more than one source -- I forget where I got mine, but it is VERY handy in a situation like yours.

      Comment


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

        yeah, it's a laptop (it's days are numbered too, the power cord's wires are exposed and it's about to give in) and i'll have to have one of those in the link you gave me, but i thought a simpler solution would be to install something on a USB flash drive (i have a 4 GB Kingstone one, i assume it's enough for something or other), go into it via the recovery console, UNmount the troublesome partition and THEN do fsck on it. how about that? is that doable?
        it might be possible for me to get an external optical drive from my neighbor, but borrowing it is a last resort thing. i assume i can, if i borrow it, load the live CD and do fsck from there, no?

        Comment


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

          You have to have a running OS to use fsck -- it can't "run" from a data storage device. If you could make any kind of Live "CD" run from your USB stick, then it would work, but you said it is a non-bootable stick so that's not gonna work.

          Yes, if you had an external USB optical drive then a bootable Live CD on that would do the trick.

          Comment


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

            I still think you have some options. Your best option is removal of the problem disk from the desktop into an enclosure, hook it to the laptop and check the partitions from the laptop. If you don't have an enclosure, I do have one advanced technique which has not been offered thus far, doing a chroot after repairing the /home partition.

            If we assume your drive is not bad and all you need is a file system check and repair then the first step is to open a terminal as root. You posted your partition setup previously and you have both a root and home partition. If you are logged in as root then your home directory should be /root, not /home/<whatever> so you can unmount the /home partition (/dev/sdb7), check it and repair it.

            Issue these commands from a root terminal:
            Code:
            umount /home
            fsck -t ext4 /dev/sdb7
            If that works and you have enough space on /home, you can remount /home and copy the files from your root partition to a temporary directory on the /home partition. Create a new directory under /home named rootfs (from command-line: mkdir /home/rootfs) then you need to issue a rsync command like the following (I'm sure we can refine it a little bit to minimize the files copied)

            Code:
            sudo rsync -av --one-file-system --exclude=/proc/* --exclude=/dev/*\
             --exclude=/sys/* --exclude=/tmp/* --exclude=/home/*\
             --exclude=/lost+found /home/rootfs
            Finally you need to chroot to the temporary system under /home/rootfs
            Code:
            sudo mount -o bind /dev/ /home/rootfs/dev
            sudo mount -t proc proc /home/rootfs/proc
            sudo mount -t sysfs sysfs /home/rootfs/sys
            sudo chroot /home/rootfs /bin/bash
            Now you should be able to unmount the root partition and check it. If that is successful, reboot, delete /home/rootfs and back in business.

            Cheers, UK

            linux &amp;&amp; bash = &quot;the future&quot;

            Comment


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

              Originally posted by josefko
              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.
              Unetbootin is in Kubuntu repos too.
              I see you didn't give a try. For most flash disks unetbootin makes them bootable during preparing live USB.
              Kubuntu 16.04 on two computers and Kubuntu 17.04 on DELL Latitude 13

              Comment

              Working...
              X