Monday, March 30, 2009

Lost /home in Kubuntu

So, I had my home set up in ext4 format on my SDHC card running in my left card reader... I don't know if this was part of the problem or not, but everything was pretty much corrupted. I thought that I could restore things using the fsck command, but that ended up going on forever. I thought maybe a mke2fs would work, but that ended up changing the filesystem from ext4 to ext2. I decided just to keep it as ext2, then set up a partition table for it, as that was part of the problem. Of course this changed the UUID of the SDHC card, so I had to update my fstab to reflect both the ext2 and uuid differences for automounting as /home. Now that my card would pass the fsck as clean, it was completely wiped.

To get a working user set up, I had to add a user...
sudo adduser test
which creates a user named test with the default settings from your /etc folder which is not on the SDHC card, so I figured this would work. I logged in as test, then rebooted the computer to a command prompt and logged back in under my own user as I still could not log in at the login screen using my user to create my user directory using the mkdir command. from my home directory I copied the test folders contents into my user directory using
sudo cp -rP /home/test/* /home/username/.
then change the owner of the files from root to me by changing directory to your user folder
sudo chown username:username *
sudo chown username:username .*
and wallah... it seems to be working for now, but none of my settings, but I can use my OS again... time to start making backups... luckily I didn't have anything important yet.

2 comments:

  1. Well, I guess a little too soon here. I thought it was working just fine, then when I started up my Acer today I had to mount the /home directory myself... I'll look into it, but can't figure out why my fstab isn't automatically mounting it. If anyone actually stumbles across my blog and knows a thing or two about Linux... I'd greatly appreciate the help

    ReplyDelete
  2. Realized my SDHC card had not been formatted correctly... it looked good when I did fdisk -l, but when I looked in parted, I realized that it wasn't actually in ext2 format. So, I backed up my /home directory, reformatted the SDHC card and copied over the files as described above, then had to change the owners cuz I used sudo cp... which you don't actually have to do, and to it works better if you do it this way

    sudo chown -R username:username /username

    ReplyDelete