DIGIT-ARC read-only archive · snapshot: July 23, 2026

swapping a distro-from one hdd to another

10 posts · originally from https://geek.digit.in/community/threads/swapping-a-distro-from-one-hdd-to-another.80272/

praka123
praka123 Original post #1
Feb 14, 2008 at 1:47 PM
My hdd seagate 80GB sata failed 2 week back.
I copied the whole Debian partition into my new 160GB hdd's ext3 partition made for this(not did a "dd").

later I chrooted into the Debian Sid install via Ubuntu.
I mounted debian partition on Ubuntu and:
Code:
mount /dev/sda10 /mnt

Code:
mount -t proc proc /mnt/proc

Code:
mount --bind /dev/ /mnt/dev

Code:
chroot /mnt /bin/bash

Then I removed the grub from Debian and apt-get install --reinstall grub
I reinstalled grub natively as:
Code:
grub>root (hd0,9)

Code:
setup (hd0)
then,
Code:
grub-install /dev/sda
that's it.
when rebooted,grub menu is shown.I can boot into Debian and login with my local username.
wait!but from here the menace starts :evil: :D
I CANNOT login via terminal or any virtual terminal as root!
wtf?
So,In panic,I tried resetting password via grub option to kernel(I use upstart in Debian in place of sysVinit) "rw init=/bin/bash"
changed password.
in that root terminal.I modprobed all needed modules manually(pppoe etc)
connected to my adsl pppoe connxn,
Code:
apt-get install --reinstall linux-image-`uname -r` grub dpkg bash

also,I did a :
Code:
source /etc/profile

as mkinitrd is complaining LANG etc env variables were missing

I, (my debconf settings is "medium") as root
Code:
dpkg-reconfigure --all

I did a:
Code:
apt-get install --reinstall login libpam-runtime
to solve the /bin/su not having suid bit set .
So,Happy times!
Hope this benefits others too :)
slugger
slugger #2
Feb 14, 2008 at 1:52 PM
OFFTOPIC
shudn't u put it in tutorials or sumthin
T
Feb 14, 2008 at 3:01 PM
Useful info
MetalheadGautham
Feb 14, 2008 at 3:40 PM
nice one. hope your failed HDD is still under warrenty. And quick thinking.
praka123
Feb 14, 2008 at 3:54 PM
^yes! :D my hdd's under warranty ;)
phreak0ut
Feb 22, 2008 at 12:31 PM
Hey, good stuff man! Thanks for this.
The_Devil_Himself
Feb 22, 2008 at 2:56 PM
wow man thats awesome.It will be useful.
Faun
Faun #10
Feb 22, 2008 at 5:32 PM
thats geeky...u got brains