Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-06-2004, 01:25 AM
|
#1
|
|
Member
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168
Rep:
|
Low Harddisk space. Can I just transfer the entire Linux to a bigger harddisk?
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 1.1G 948M 75M 93% /
tmpfs 251M 0 251M 0% /dev/shm
/dev/hda2 462M 51M 387M 12% /home
I'm going to install a bigger harddisk as slave, and then partitioned it :-
/dev/hdb1 /
/dev/hdb2 /home
mount /dev/hdb1 /mnt/hdb1
mount /dev/hdb2 /mnt/hdb2
(Are these the right commands to copy the entire content on the original harddisk to the new harddisk?)
cp -pR /*.* /mnt/hdb1
cp -pR /home/*.* /mnt/hdb2
Afterwhich, physically swap both harddisk, so that the bigger harddisk is now the master and the original harddisk the slave. Will the drive letter be automatically updated? ie. the new harddisk when plug in as master will automatically be hda and the original harddisk ,which is plug in as slave, be hdb?
Is this the correct method?
Thanks !
Last edited by davidas; 04-06-2004 at 02:45 AM.
|
|
|
|
04-06-2004, 02:08 AM
|
#2
|
|
Member
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403
Rep:
|
never tried it, but anyway you have to install you're favorite bootloader on the new drive too...
|
|
|
|
04-06-2004, 02:44 AM
|
#3
|
|
Member
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168
Original Poster
Rep:
|
mount /dev/hdb1 /mnt/hdb1
mount /dev/hdb2 /mnt/hdb2
(Are these the right commands to copy the entire content on the original harddisk to the new harddisk?)
cp -pR /*.* /mnt/hdb1
cp -pR /home/*.* /mnt/hdb2
/sbin/grub-install /dev/hdb1 <------ would this suffice?
Afterwhich, physically swap both harddisk, so that the bigger harddisk is now the master and the original harddisk the slave. Will the drive letter be automatically updated? ie. the new harddisk when plug in as master will automatically be hda and the original harddisk ,which is plug in as slave, be hdb?
Quote:
Originally posted by iluvatar
never tried it, but anyway you have to install you're favorite bootloader on the new drive too...
|
|
|
|
|
04-06-2004, 02:49 AM
|
#4
|
|
Member
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558
Rep:
|
Just to continue with Iluvatar's answer, do the following to install the bootloader on hdb:
chroot /mnt/hdb1
/sbin/lilo
exit
The 'chroot' command changes root to /mnt/hdb1, your "new root". When you run lilo, it will execute from the "new root" on /mnt/hdb1, and install your bootloader to the MBR on hdb1.
Hopefully, when you reboot with your new hard-disk, everything should work.
|
|
|
|
04-06-2004, 02:50 AM
|
#5
|
|
Member
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403
Rep:
|
well, I don't know if it's going to work. it looks ok to me, and at least you always have your old harddisk as backup  I would say: try it  I don't know about grub, I'm used to lilo, got grub running now for 3 days or so...
good luck with this 
-= iluvatar =-
|
|
|
|
04-06-2004, 02:54 AM
|
#6
|
|
Member
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558
Rep:
|
If you're using grub, then substitute 'lilo' with 'grub' in my post.
|
|
|
|
04-06-2004, 03:43 AM
|
#7
|
|
Member
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168
Original Poster
Rep:
|
Thanks for all the help!
After doing a chroot /mnt/hdb1, and installing the grub into the MBR of hdb1, I'll take out the orginal harddisk (hda) and swap it with the new harddisk (hdb), so that the new harddisk is now the master drive. Will the new harddisk become hda automatically (instead of hdb previously) since it is now connected as master? If so, will the bootloader try to boot up from hdb1 (since it was chroot /mnt/hdb1 and grub-install) ?
PS. Could you elaborate on chroot please? Also, how do you get out of chroot? exit?
Thanks !
Quote:
Originally posted by spurious
Just to continue with Iluvatar's answer, do the following to install the bootloader on hdb:
chroot /mnt/hdb1
/sbin/lilo
exit
The 'chroot' command changes root to /mnt/hdb1, your "new root". When you run lilo, it will execute from the "new root" on /mnt/hdb1, and install your bootloader to the MBR on hdb1.
Hopefully, when you reboot with your new hard-disk, everything should work.
|
|
|
|
|
04-06-2004, 03:49 AM
|
#8
|
|
Member
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403
Rep:
|
hi there!
do not mixup primary / secondary ide connector and master / slave thing... master / slave is just a jumper setting wich doesn't affect the devicelist in linux /dev/ the hda / hdb ( /hdc & hdd) are the different ide channels in your pc. physically swapping the drives is correct for changing their presence in the devicelist. master / slave settings don't do anything in this. after doing the chroot command, grub will install it's config to the master boot record of hdb, the config will be that of hda, so after swapping the drives it would be correct.
greetinz
-= iluvatar =-
|
|
|
|
04-06-2004, 03:59 AM
|
#9
|
|
Senior Member
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,164
Rep:
|
when you run chroot with one command after it, you go back to the original root when the command finishes.
if you just did chroot /mnt/hdb1, then you would have to exit
using the cp command isn't as good for tar with such things.
tar clfvp - .|(cd /mnt/hdb1; tar xpf - --same-owner)
copies everything starting in current directory and below to /mnt/hdb1
Last edited by whansard; 04-06-2004 at 04:01 AM.
|
|
|
|
04-06-2004, 07:08 PM
|
#10
|
|
Member
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168
Original Poster
Rep:
|
How does the system differentiate between two harddisks on the same ide channel in the devicelist, of which one is the master and the other is the slave?
Thanks !
Quote:
Originally posted by iluvatar
hi there!
do not mixup primary / secondary ide connector and master / slave thing... master / slave is just a jumper setting wich doesn't affect the devicelist in linux /dev/ the hda / hdb ( /hdc & hdd) are the different ide channels in your pc. physically swapping the drives is correct for changing their presence in the devicelist. master / slave settings don't do anything in this. after doing the chroot command, grub will install it's config to the master boot record of hdb, the config will be that of hda, so after swapping the drives it would be correct.
greetinz
-= iluvatar =-
|
|
|
|
|
04-06-2004, 09:00 PM
|
#11
|
|
Senior Member
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,164
Rep:
|
hda- primary master
hdb-primary slave
hdc- secondary master
hdd-secondary slave
Last edited by whansard; 04-06-2004 at 09:02 PM.
|
|
|
|
04-12-2004, 12:00 PM
|
#12
|
|
Member
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168
Original Poster
Rep:
|
Do I need to tar /proc, /dev, /mnt, lost+found directores and transfer them to the new harddisk? Tar seems to have difficulty archiving /proc and /dev directories. If that is the case, when I boot up on the new harddisk (without transferring /proc and /dev from the old harddisk), will /dev and /proc directories be automatically re-created on the new harddisk?
Or will it won't even boot up?
Thanks !
Quote:
Originally posted by whansard
when you run chroot with one command after it, you go back to the original root when the command finishes.
if you just did chroot /mnt/hdb1, then you would have to exit
using the cp command isn't as good for tar with such things.
tar clfvp - .|(cd /mnt/hdb1; tar xpf - --same-owner)
copies everything starting in current directory and below to /mnt/hdb1
|
|
|
|
|
04-13-2004, 02:03 AM
|
#13
|
|
Senior Member
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,164
Rep:
|
do the whole partition in one shot from a rescue cdrom.
you'll still have to set up the boot loader.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:07 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|