first time poster here - hello everyone
I started out with CentOS x86 5.3 with the following partitions on my source hard drive: /dev/hdc1 swap /dev/hdc2 /
I did the following to migrate my CentOS box to the destination hard drive: 1. boot up with CentOS 5.3 livecd in rescue mode 2. partition destination hard drive (/dev/hdd) /dev/hdd1 swap /dev/hdd2 / 3. create the filesystem on the destination hard drive mke2fs -j /dev/hdd2 mkswap /dev/hdd1 4. mount partitions and then copied files from /dev/hdc2 to /dev/hdd2 mount /dev/hdc2 /mnt/aa mount /dev/hdd2 /mnt/bb cd /mnt/aa tar --one-file-system -cf - . | tar -xpf - -C /mnt/bb 5. modify /boot/grub/menu.lst on both /dev/hdc2 and /dev/hdd2 6. modify /etc/fstab and /etc/mtab 7. umount partitions 8. run grub 9. reboot out of rescue mode
The original system still boots up fine and I am able to login. The new system which is supposedly a copy of the original system seems to boot up fine (everything had green OK), but I have problems at the login prompt. If I login with incorrect password, I get a message telling me that login is incorrect. If I try to login with the correct password, the system seems to accept the password, but then prompts me again to login, and it keeps doing this when I continually try to login.
additional info: 1. can boot up system in single user mode 2. sshd is up but can't ssh in even with correct password here's the output (i modified the user name and the ip address) ssh -l user1 ipaddress user1@ipaddress's password: /bin/bash: Permission denied Connection to ipaddress closed.
I'm sorry if this has already been addressed in the forums/mailinglists, but my attempted search didn't show me anything fruitful. Also, I'd don't want to use dd, and I would prefer not to use partimage. Your help will be appreciated and thanks for reading this far.
choyaumeshu wrote:
first time poster here - hello everyone
<snip>
tar --one-file-system -cf - . | tar -xpf - -C /mnt/bb
<snip>
hi, a wild guess: --selinux ?
On 09/03/2009 09:00 AM, choyaumeshu wrote: ...
tar --one-file-system -cf - . | tar -xpf - -C /mnt/bb
...
/bin/bash: Permission denied
Looks like a SELinux problem. Try booting in rescue mode, mount root, and do a
touch /mnt/sysimage/.autorelabel
and a reboot.
Mogens
On Thu, Sep 3, 2009 at 4:55 AM, Mogens Kjaer mk@crc.dk wrote:
On 09/03/2009 09:00 AM, choyaumeshu wrote: ...
tar --one-file-system -cf - . | tar -xpf - -C /mnt/bb
...
/bin/bash: Permission denied
Looks like a SELinux problem. Try booting in rescue mode, mount root, and do a
touch /mnt/sysimage/.autorelabel
and a reboot.
Mogens
Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Fax: +45 33 27 47 08 Email: mk@crc.dk Homepage: http://www.crc.dk _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Here's a update: I. I did what Mogens suggested: a. reboot into rescue mode with livecd b. mount root partition c. run 'touch /mnt/sysimage/.autorelabel d. reboot and I was able to login successfully - thank you all for your suggestions
II. However, for curiosity sake, I did the following: a. fresh install of CentOS x86 5.3 install w/ /dev/hda1 swap /dev/hda2 /boot /dev/hda3 /home /dev/hda5 / this system booted up fine b. migrate the /dev/hda system to /dev/sda using the rescue livecd with the following partition /dev/sda1 swap /dev/sda2 / c. edit grub, fstab, mtab, and run grub d. reboot the new system
e. grub cannot find my kernel image BUT f. the migration is successful if the partition of /dev/sda mirrors the table setup for /dev/hda
I don't know why the partition setup has to mirror the original, but I wanted to share this info with the community. I assume all this is SELinux related. Thanks again.
From: choyaumeshu choyaumeshu@gmail.com
I did the following to migrate my CentOS box to the destination hard drive: 5. modify /boot/grub/menu.lst on both /dev/hdc2 and /dev/hdd2 6. modify /etc/fstab and /etc/mtab additional info:
- can boot up system in single user mode
- sshd is up but can't ssh in even with correct password
Nothing in the logs? Maybe do an strace on the login and try to see what makes it fail. I would suspect a missing suid bit (to read /etc/shadow by example)... Try 'rpm -qaV' BTW, did you change all the machine specific things like MAC addresses, ssh server private keys, etc...?
JD
Hi! check perms on /tmp for example chown -R root.root /tmp & chmod 777 /tmp
choyaumeshu schrieb:
first time poster here - hello everyone
I started out with CentOS x86 5.3 with the following partitions on my source hard drive: /dev/hdc1 swap /dev/hdc2 /
I did the following to migrate my CentOS box to the destination hard drive:
- boot up with CentOS 5.3 livecd in rescue mode
- partition destination hard drive (/dev/hdd) /dev/hdd1 swap /dev/hdd2 /
- create the filesystem on the destination hard drive mke2fs -j /dev/hdd2 mkswap /dev/hdd1
- mount partitions and then copied files from /dev/hdc2 to /dev/hdd2 mount /dev/hdc2 /mnt/aa mount /dev/hdd2 /mnt/bb cd /mnt/aa tar --one-file-system -cf - . | tar -xpf - -C /mnt/bb
- modify /boot/grub/menu.lst on both /dev/hdc2 and /dev/hdd2
- modify /etc/fstab and /etc/mtab
- umount partitions
- run grub
- reboot out of rescue mode
The original system still boots up fine and I am able to login. The new system which is supposedly a copy of the original system seems to boot up fine (everything had green OK), but I have problems at the login prompt. If I login with incorrect password, I get a message telling me that login is incorrect. If I try to login with the correct password, the system seems to accept the password, but then prompts me again to login, and it keeps doing this when I continually try to login.
additional info:
- can boot up system in single user mode
- sshd is up but can't ssh in even with correct password
here's the output (i modified the user name and the ip address) ssh -l user1 ipaddress user1@ipaddress's password: /bin/bash: Permission denied Connection to ipaddress closed.
I'm sorry if this has already been addressed in the forums/mailinglists, but my attempted search didn't show me anything fruitful. Also, I'd don't want to use dd, and I would prefer not to use partimage. Your help will be appreciated and thanks for reading this far.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi! check perms on /tmp for example chown -R root.root /tmp & chmod 777 /tmp
Don't chown everything under /tmp to root:root! Don't chmod /tmp to 777!
chown root:root /tmp chmod 1777 /tmp
Alexander