LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   big project for a newbie (https://www.linuxquestions.org/questions/linux-newbie-8/big-project-for-a-newbie-288770/)

joel b 02-10-2005 10:56 PM

big project for a newbie
 
Hello - I have only Suse 9.1 personal on my computer - 4 users and 70 gigs of music in my home directory. I have another 90 gig HD that was used by a Windows machine - I want to:
1. Add the second drive and put the /home directory on that drive
2. change the parameters of my current disk to add a windows partition that I can start at boot if I want.
my thinking here is I can make changes to my distro or kernal or whatever and not lose my /home data. Is there a particular order I should do this? I know very little about the command line, and would like to do this from KDE if possible, or else you will have to explain things REAL SLOW. My current disk drive is 90% full!

Thanking everyone in advance -

Joel
Phoenix AZ
USA
:-)

Mr. Hill 02-11-2005 12:24 AM

Wow 70 gigs. I dunno what to tell you except back up everything you want to keep! If that music is worth something to you (it obviously is) then back it up. If you completely screw things up you can always get it back.

I also think that cloning the drive and fusing it in their would be a good idea.

dping 02-11-2005 01:10 PM

Do you have a cd burner?
Is there anything you want to save on the second (90GB) hard drive?
Do you know how to set a hard drive to master or slave and how to attach cables? (ie: do you know how to install it in the case?)

gd2shoe 02-11-2005 04:48 PM

Here's the general order that I would do it:

Create a knoppix disk. You can do it without one, but it will make it easier.

Copy EVERYTHING to the 90 GB drive. You might not want to here it, but do this as root user from the console.

Resize or repartition your 70 GB drive.

Install Windows.

Copy everything but /home back to your system (or reinstall SuSE).

Run the recovery function on SuSE's install CD (to get your boot loader back)

Modify your /etc/fstab to refer to your /home on the other drive.



Disclaimer: I sometimes don't know as much as I think I do. Use your own judgment. You may want to follow the advice of others here and get your data backed up first.

Knoppix is invaluable for this project. In fact, I would do most (or all) of the work from Knoppix. Knoppix is a live CD. It contains an entire distribution of debian linux that runs from the CD. It makes an excellent tool for working with your linux system (without your linux system in the way). You can get Knoppix from either www.knoppix.net or www.knoppix.com.

Once you have booted off of knoppix, look for qtparted. This is a graphical program for partitioning drives, much like partition magic. Make sure your new hard disk (I'm assuming primary slave: /dev/hdb) is formated With a linux style file system (ext3 and reiserfs are safe bets). Now open a root console (from the penguin menu) or switch to tty2-4.

cd /mnt
ls

Make sure you see hda1 and hdb1. If one of them does not exist, then create it with "mkdir hdb1". Now mount them for reading and writing.

mount /dev/hda1 /mnt/hda1
mount /dev/hdb1 /mnt /hdb1 -o rw

The -o rw is probably not needed. You will need to make sure it is in read/write mode though. If you had mounted the partitions from the KDE desktop, you will need to change it to read/write mode (right click on it and look for the option).

cp /mnt/hda1/* /mnt/hdb1 -R --preserve=all

This command should copy everything from your first drive onto your second. Undoubtedly this will take a while. The "-R" is for recursive; in other words, all the directories and everything in them. The "--preserve=all" should make sure that ownership of copies stays the same, that links remain links, etc. You would have problems otherwise. If you were to try this copy from Your running SuSE system, you would copy from /, and add a "-x" to the end. That would prevent coping stuff from proc and sysfs that you wouldn't need. Make sure that everything you need has been copied

Once that is done (and you have verified that your important files have been copied), then fire up qtparted again. If you clear up some space on the partition first, qtparted may be able to shrink your partition for you. If not, then delete the partition and create at least 2 new ones (an additional small fat32 partition is preferable for moving stuff from linux to windows 2000/XP. Linux can, but shouldn't, write to an NTFS partition) (a small partition for /boot is also handy).

Now copy back everything (unless you intend to reinstall SuSE). Well, not everything. Obviously don't copy over the huge load of files that you wanted moved (remember to use --preserve=all).

Now you may want to rearrange your second drive a bit. Remember, if you want to treat it as your /home, then you will need it to be arranged that way. use the mv command to shift things around. I'd do something like:

cd /mnt/hdb1
mkdir OldInstallation
mv * OldInstallation
cd OldInstallation/home
mv * ../../

You should have the folders holding your users home directories at the top of /mnt/hdb1.

Now install Windows. Normally it is best to install Windows before Linux. The Windows installer will overwrite the MBR of the drive, making it impossible to boot anything Windows. Because of this, you will need to install your linux boot loader after Windows is installed. I don't recall exactly how to do this from the SuSE Installation CD, but it can be done. It can also be done from knoppix 3.7, but I think the SuSE CD will be easier.

If Windows isn't automatically added to the boot menu, then you will need to edit your /boot/grub/menu.lst . Post back if you need to (it isn't hard, but I don't feel like taking the time at the moment).

Last, but not least, modify your /etc/fstab. This file keeps track of which partitions get mounted where. Add something like this:

Code:

/dev/hdb1      /home      reiserfs    acl,user_xattr        1 2
(here reiserfs is assumed. If the partition is ext3, then use that instead.) (This line was copied from my SuSE fstab and modified slightly. I think this is what should be used.)

Boot your system and see what happens. The "df -h" command can be useful to see drive usage, and to tell which partitions are mounted where.

Post back here if I've left something unclear (or if you have trouble (inevitable ;) ).)


All times are GMT -5. The time now is 11:58 AM.