LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can I move my Linux installation to another drive? (https://www.linuxquestions.org/questions/linux-general-1/can-i-move-my-linux-installation-to-another-drive-596264/)

dms05 11-01-2007 03:56 AM

Can I move my Linux installation to another drive?
 
I have my Acer laptop dual booting to XP and PCLinuxOS 2007. XP and Linux share drive C: and I use lilo for booting. The Linux bit works well but recently XP has become very corrupted and needs to be reinstalled.

My laptop HDD is configured as 2 drives (C: and D:) of 50GB each. Is it possible to move the Linux to D: before reformatting C: (and expect it to be still available after XP is reinstalled)? Or do I have to accept that the XP failure means I have the loss of my Linux installation and need to start again for both OS's?

I'd like to finish up with Linux on D: and XP on C:. Would that work?

Vincent_Vega 11-01-2007 08:22 AM

You can reinstall XP by only formatting that partition. No reason to lose your linux installation. Just don't go for the option to use the entire drive.

arubin 11-01-2007 08:53 AM

Your question is confusing because you are using DOS labels to describe your hard drive set up when what you really need to know is how your drive is partitioned.

Does your laptop have one or two physical drives?

C: and D: refer to hard drive partitions that Windows can see. Are you realy suggesting that your linux partition is on the same partition that is used by XP? It seems unlikely to me.

I suggest you post the output of fdisk -l so that it is clear what your set up is.

As far as moving the entire linux installation to another is concerned my answer is, yes, it can be done.

dms05 11-01-2007 11:35 AM

fdisk
 
The output is:

fdisk -l

Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 382 3068383+ 12 Compaq diagnostics
/dev/hda2 * 383 4650 34282710 c W95 FAT32 (LBA)
/dev/hda3 4651 6240 12771675 5 Extended
/dev/hda4 6241 12000 46267200 c W95 FAT32 (LBA)
/dev/hda5 4651 5613 7735266 83 Linux
/dev/hda6 5614 5806 1550241 82 Linux swap / Solaris
/dev/hda7 5807 6240 3486073+ 83 Linux

Disk /dev/sda: 2097 MB, 2097152512 bytes
255 heads, 63 sectors/track, 254 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 255 2047969 c W95 FAT32 (LBA)
Partition 1 has different physical/logical endings:
phys=(253, 254, 63) logical=(254, 245, 56)

Disk /dev/sdb: 2002 MB, 2002255872 bytes
58 heads, 57 sectors/track, 1182 cylinders
Units = cylinders of 3306 * 512 = 1692672 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 1183 1955263+ b W95 FAT32

Disk /dev/sdd: 65 MB, 65536000 bytes
8 heads, 32 sectors/track, 500 cylinders
Units = cylinders of 256 * 512 = 131072 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 500 63972+ b W95 FAT32


Sorry for the confusion by using DOS labels! I'm still getting to grips with Linux terminology. Basically it's a laptop with an approx 100GB HDD that is split into 2 identical drives using DOS terms. Using Unix terms hda1 is the hidden partition containing a recovery copy of XP. hda5/6/7 are the Unix partitions and the rest are currently XP. In DOS terms hda2/3/4 are for XP with hda4 been the DOS D: drive.

arubin 11-01-2007 01:25 PM

It is not clear what you want to do. Do you want to move Linux onto the space currently occupied by hda4, 6241 to 12000?

dms05 11-01-2007 04:46 PM

Exactly. Linux to hda 4. I can then reclaim the rest for XP.

arubin 11-01-2007 05:39 PM

I think it would also help if you told us how your linux is spread across your partitions. Could you post the contents of /etc/fstab.


The truth is that the way your partitions are arranged is a bit of mess with your extended partition in the middle. You will need to work out a strategy to deal with this.

I would suggest
1. format hda4 as ext3
2. copy linux to hda4
3. change /etc/fstab and lilo so that linux is booting onto hda4
4. rewrite your partition table so that you have

hda1 1 382
hda2 383 around 6050 for XP
hda3 6050 6240 swap (the value of 6050 might be giving you more swap than you really need)
hda4 untouched

5. format hda2 for XP
6. Reinstall XP

All this is fraught with danger that you might trash your system so back up any data first.

ch485de 11-02-2007 03:05 AM

Many thanks for you time and interest. The disorganised nature of my HDD derives from having XP and 2 DOS drives on a single physical drive. I simply installed PCLinuxOS 2007 from the LiveCD and selected the options that were offered automatically.

However your suggestions on rearranging the various partitions look a very good starting point and I will begin by backing up my data!

I did try to use 'remasterme' on my present PCLinuxOS installation with the intention of producing my own version of the iso file and using that to reinstall. However that didn't go well (it wouldn't work in Konsole but did using Xterm) and the resultant DVD (c.1.5GB) wouldn't boot even though I've burnt iso images before and know what to do). Now my PCLinuxOS User A/c won't start from the HDD and reports kstartupconfig is missing - however the Root account still functions.

arubin 11-02-2007 03:57 AM

It makes you wonder with a cumbling XP and odd missing files whether your hard disc is failing.

As far as your user account is concerned you might try deleting (or just renamimg /home/user/.kde

That would wipe out all your KDE settings for the user but you ought to be able to use it with fresh settings.

Vincent_Vega 11-02-2007 09:37 AM

The only way you can 'reclaim' any of the drive for XP is to reformat the whole drive and restructure your partitions because hda3 is the extended partition that only encompasses partitions hda4-7. You don't use hda3 the way you use hda2,4,5,7. It just allows you to have more partitions than if you used only 'primary' partitions.
It seems to me that you could just reinstall XP to hda2, where is already is, without touching anything else. I would suggest using NTFS for XP since there is good support for accessing that now too. Why would you want to move your linux installation?

ch485de 11-03-2007 03:04 AM

Many thanks everyone for your contributions.

I've decided to have a complete fresh installation of both XP and Linux. Not the easiest or quickest but perhaps the safest. I can then install both OS's where I want them and tidy them up.

All the problems were caused by XP and not Linux. I've learnt my lesson about keeping them both well apart so I can recover XP without destroying my very stable Linux installation in future.


All times are GMT -5. The time now is 03:27 PM.