We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Moving drives?

BoB
BoB asked
on
Medium Priority
217 Views
Last Modified: 2010-04-20
I am currently running a slakware version of linux (I can't remember the version, but it's not too outdated) on the uncompressed partition of a dos-formatted drive compressed with Drivespace 3 (I'm using exclusively umsdos partitions).  That device is hda1.  I bought a new harddrive which is partitioned into several parts, the part I am interested in is hdb6.  I can mount that drive and use it without any problems.  Now I would like to (if possible) move my entire linux system over to the hdb6 device (1 gig is better than 150MB).  I startup linux using a boot disk so that will probably need to be changed also.  If I can't make a complete move, then I would like to move just the directories that will grown the most (I take that to be /usr and /home.  
Comment
Watch Question

adt

Commented:
Moving your Linux installation should work ok.

You should format the new partition with mke2fs and mount under something like /new
under linux.  Then you should 'cp -a' all of files a and directories in the root, except /new
to /new.

             SO:  cp -a usr new
                     cp -a vmlinuz new
                     ....

You'll then  want to cd /new and 'rdev -R vmlinuz 1' and 'rdev vmlinuz /dev/hdb6'.

You'll also then want to change /new/etc/fstab to reflect any new mount points and
filesystem types.

                    most notably, your entry for / should be something like
                    /dev/hdb6   /                          ext2   defaults  0  1


You can still boot with a boot disk, if you like.
               
                    you need to take a new disk (not your original linux boot disk) and:
                    'dd if=/new/vmlinuz of=/dev/fd0'
                    'rdev -R /dev/fd0 1'
                    'rdev /dev/fd0 /dev/hdb6'

I you'd like to use lilo instead, I'll submit a working lilo.conf later.

BoB

Author

Commented:
There is no vmlinuz file anywhere in my linux partition.  (that's the kernal right?)  I think my kernel is located in the linux/src directory (vmlinux is the filename) so is that what I am actually looking for for the rdev command?
the kernel can have lots of different names
vmlinuz
zImage
.

I think I remember slakware calling it zImage when I compiled it.
You can guess the name of the kernel by looking at /etc/lilo.conf if you use lilo and the batch file you use to start linux if you are using loadlin. There you will find both the name of the image and the path to it.
If you want to move only a few directories, you could try the following:

copy the entire directory from one partition to another
(you can do it file by file or by using tar)
Look for every link on the complete original partition pointing to the directoy you are moving!!!

this can be done with find, file and grep commands

rename the original directory to something different (add an underscore or so...) and then make a link to the new directory with the original name.

take care when moving important directories (i.e. /bin, /usr/bin)
because when you change the name of them you should then write the complete pathname for example when calling 'ln' to make the link. Just take a look at the location of these commands.

hope this helps
pablo
pablocosta@iname.com
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.