Unable to login after replacing hard drive

Okay, I am running OpenSuse 11.4 with Gnome3, with 2 hard drives. One is for the system and has three partitions - root, swap, and home. The second is only data storage. Last week I started getting popups stating I had a hard drive going bad. I checked SMART status in disk utility and had several bad sectors on the system drive, so I cloned the drive to a new one with Clonezilla. Here is where everything went kooky. When I booted the new disk I had a ton of errors at boot along the lines of unable to find a drive. Upon closer inspection I realized the the system located the drives by device id instead of the traditional /dev/sdx. So I started playing with grub settings but never could get it to stop looking for the old hdd. Next, I popped in my net install disc and found I could do an upgrade install which proceeded normally. When I rebooted, no more boot errors, but I get to the black screen with spinning cursor and it will not proceed any further, I even let it run overnight and when I woke up, spinning cursor. As for troubleshooting, I was able to CTRL+ALT+F2 to a console and log in as root successfully but not as a user. When I try to log in as a user, I enter my username, then password, the “have a lot of fun” flashes by quickly and I am returned to a login prompt. I logged in to the console as root and created a new user and tried logging in again, but same thing. I am able to do an ls -l on /home/mike and all my files are there and the listed permissions look ok. I am at a loss as to what to try next. My old hdd will still boot, I just pulled it to reduce risk af data loss. I have never used auto yast before but I always see the prompt for it during an install. Can I clone the system with auto yast on to a different hard drive. Does it strip the by-device-id from the image? Which logs should I check? Thank you in advance.

The trouble with using clonezilla is that devices are mounted in fstab by device id under opensuse by default, your new drive won’t have the same id, so unless you change this first you will encounter problems

With a new drive I wouldn’t use an image of an old drive anyway tbh mate, I would do a reinstall then copy important stuff like the /home directory, configuration files for programs/services under /etc/ that you spent time setting up and don’t wish to repeat, databases etc etc etc

On the average desktop just the /home is good enough I find, different matter if you’re running server stuff

Given that your drive is saying it’s starting to fail be a good idea to boot off it (or plug it in and boot off a live cd/usb might be even better) and copy everything important off it to that second data drive if you can first

Don’t know if you know about these but you may find Yast Backup & Restore useful, and there’s a program I find useful called Lucky Backup which you can find on software.opensuse.org with a search and you should get a 1-click install result. Lucky Backup uses rsync so it can be configured to do periodic incremental updates of your backups and can also backup your files to remote servers, simple to use

Thank you, I will try the Yast and/or lucky first, before I do a reinstall. I had just gotten everything setup, all my applications installed and configured and had not done a backup yet. (Bad me) Thank you for the suggestions, I will post tomorrow with results, hopefully from that PC :slight_smile:

Most of your application/desktop configuration stuff is in your /home/username folder mate so it ain’t all bad :wink:

Other config stuff is under /etc

It’ll be the updates and extra apps needing installation that’ll take the most time probably

Best of luck

Absolutely. If you were using UUIDs (which are written in the partitions superblocks and so don’t change unless you reformat them), you woudn’t have trouble by cloning hard disks. Now all you have to do is to edit /boot/grub/menu.lst and /etc/fstab on the clone and write either the right disk ids there or use partition UUIDs instead. The following commands might help:

find /dev/disk/by-id -ls | awk '{ print $11,  "->", $13 }'

su -c /sbin/blkid

as well as the script partinfo](http://forums.opensuse.org/english/other-forums/development/programming-scripting/461462-partinfo-displaying-partition-infos.html#post2353213).

Notice that you might have to replace the swap partition id in /etc/sysconfig/bootloader too… otherwise you won’t be able to resume (or even boot). I don’t know why openSUSE uses disk ids by default. You can choose to use UUIDs during setup in the fstab options (but who thinks about that?).

Yes, reinstalling the extra stuff is what I was trying to avoid. I actually have kept the same /home partition through several distros since I built this PC a few years ago.

I just finished doing a full backup in Yast, so we will see how smoothly the restore goes…