LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-08-2009, 06:11 AM   #1
cbjhawks
Member
 
Registered: Oct 2001
Location: Overland Park, KS
Distribution: Kubuntu 22.04
Posts: 375

Rep: Reputation: 30
Wanting to switch linux from master drive to slave...how to?


My current setup:
IDE0= Master 80GB linux
Slave 200GB empty

IDE1= Master DVD-RW
Slave CD-RW

ATA/PCI Adapter
IDE2= Master 250GB backup for linux home
Slave empty
IDE3= Master empty
Slave empty

My desire is to switch the two drives on IDE0
and add WinXP on the 200GB plus dual-boot with the 80GB.

IDE0= Master 200GB WinXP
Slave 80GB linux

Can I do this without reinstalling OpenSuSE 11.0?
After switching I was hopefully to use a liveCD to reinstall
grub in the MBR. But as I was looking around in linux the fstab
file and the dev directory all pointed to sda/hda for linux.
To me it would seem easier to just reinstall...unless someone
can convince me otherwise...thoughts please...thanks.
 
Old 07-08-2009, 06:15 AM   #2
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
The best way to mirror your partitions or disk information is to use a tool like dd.

http://linux.about.com/od/commands/l/blcmdl1_dd.htm

It should be quite easy to achieve what you're looking for. But make sure that the target disk or partition is equal to or bigger than the source disk.
 
Old 07-08-2009, 08:04 AM   #3
cbjhawks
Member
 
Registered: Oct 2001
Location: Overland Park, KS
Distribution: Kubuntu 22.04
Posts: 375

Original Poster
Rep: Reputation: 30
harishankar...I'm not sure what your telling me to do...

I have heard of dd...used to backup system??...but how would that program help me in this situation? Perhaps I didnt explain my plans clearly enough...if so, I'm sorry...my fault.

Would switching linux from master to slave and then installing XP as master render my linux install unbootable? Example: /etc/fstab shows
linux as hda but by switching linux it would be hdb. How would I update
all the pointers (for lack of better term) within my linux install?
 
Old 07-08-2009, 08:46 AM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by cbjhawks View Post
I have heard of dd...used to backup system??...but how would that program help me in this situation? Perhaps I didnt explain my plans clearly enough...if so, I'm sorry...my fault.

Would switching linux from master to slave and then installing XP as master render my linux install unbootable? Example: /etc/fstab shows
linux as hda but by switching linux it would be hdb. How would I update
all the pointers (for lack of better term) within my linux install?
It's very hard to advise in this situation as it has the potential to destroy data. As to general advise, I can give you hints on where to look for solutions. I can say that you can achieve the above without reinstalling Linux.

1. dd is not just a backup system. It can even be used to mirror an entire disk as it uses low-level copying (below the filesystem level). Check out the manual page for dd to use it effectively. Since in your set up you have plenty of unpartitioned free space, it should be possible to keep one of them for backup purposes. You are the best judge of a safe backup medium.

Alternatively you can use a Shareware or commercial disk "ghost" tool. http://www.symantec.com/norton/ghost

Other free alternatives for system backup/restore or mirroring disks: http://partedmagic.com/

In effect, you're cloning one disk contents on another. This is not like a normal "backup" because it preserves filesystem informations, partition table info, partition size info etc. and even clones the free space etc. in the file system)

2. If/when your Linux is non-bootable after installing XP, you can use a Linux LiveCD like Knoppix to recover/reinstall your GRUB to the MBR as well as modify the /etc/fstab file before you boot into your Linux system. All you need to specify is the boot and root partition in your /boot/grub/menu.lst in your hard disk boot loader and you're away. This is the easy part when everything else goes off correctly.

(Note: After installing grub to the MBR, you might have to use the interactive grub shell to boot into your Linux installation the first time, but after you successfully boot Linux, you can reinstall grub from the distribution and also specify the boot entries in /boot/grub/menu.lst

3. Be careful to take a full OFFLINE backup of all your important data before you attempt this and find out exactly the device entries for each drive before you attempt it. Offline = media which you won't touch during the entire process.

It's very difficult to give a step-by-step tutorial for a project like this as this will depend on the size of your free partitions etc. It's not something you should undertake lightly, but with a bit of reading it should be possible. With your current setup, I would undertake this project, because I am experienced enough - but even I would take a full backup in case of errors or problems. I don't know how comfortable you are with this kind of process.

I cannot stress this enough: ALWAYS keep an emergency Linux LiveCD ready and take a full backup of your important before you attempt a project of this nature.

Last edited by vharishankar; 07-08-2009 at 08:57 AM.
 
Old 07-08-2009, 09:38 AM   #5
cbjhawks
Member
 
Registered: Oct 2001
Location: Overland Park, KS
Distribution: Kubuntu 22.04
Posts: 375

Original Poster
Rep: Reputation: 30
harishankar - if I understand you correctly...

I could "in theory" clone my 80GB to my 250GB drive...switch the drives, install XP(200GB) then restore my linux setup to the slave80GB...use the Knoppix CD to boot into SuSE and then reinstall the GRUB to MBR. FYI - my 250GB is always used to backup all the home directories...so I dont have the fear of losing music...pics...etc.

The only fear I have is that the restoring process wont work and I'll have to reinstall the linux os as well as all my linux programs
I have used Ghost in the past with limited results (when restoring linux)
I will check out the reading you mentioned and no I'm not in any hurry at this point...will do more research, thanks for your input!
 
Old 07-08-2009, 09:45 AM   #6
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
It should work. But you know, you never know until you try it out and see for yourself.

The biggest concern, for me personally, in such undertakings is the size which is huge. It will potentially take about half a day to go through the whole process and get everything working in an ideal scenario.

Allot plenty of time, don't do anything without thinking (I'm speaking from experience myself ) and always read carefully the manuals of any programs you use. Even if you don't lose any data, you might lose even more time in the process of rectifying mistakes done in haste.

Quote:
Originally Posted by cbjhawks View Post
FYI - my 250GB is always used to backup all the home directories...so I dont have the fear of losing music...pics...etc.
I would advice you not to rely on that alone. Keep an offline backup of your content or disconnect that drive before you start the whole process to be on the safe side.

Last edited by vharishankar; 07-08-2009 at 09:47 AM.
 
Old 07-08-2009, 03:24 PM   #7
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
It seems yet again that people here are skimming posts instead of reading thoroughly.

The easiest way is set labels for each partition for the drive that is designated for Linux. You can use gparted to make this task easier. Then edit /etc/fstab to use labels for mounting instead of regular device nodes. If it uses UUID for mounting, you still have to change to labels to make booting more predictable. Both NTFS and FAT does not support UUID, but they support labels. You then have to edit your boot loader config. By using labels for mounting, you can switch the drives all over with out creating problems. The following is an example of how to use labels for mounting and assuming linux-root is the main partition where Linux is stored.

LABEL=linux-root / ext3 defaults 1 2

Personally, I do not recommend dd or any sector to sector copy program for mirroring. It causes problems if the two drives are not the same.
 
Old 07-08-2009, 09:57 PM   #8
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by Electro View Post
It seems yet again that people here are skimming posts instead of reading thoroughly.
My understanding was that the question was aimed at swopping the contents of the partitions. Otherwise it's too easy. There's no need to be point out honest mistakes of misunderstanding which occur frequently in online communications. I'm trying my best to help here.

Quote:
Originally Posted by Electro View Post
The easiest way is set labels for each partition for the drive that is designated for Linux. You can use gparted to make this task easier. Then edit /etc/fstab to use labels for mounting instead of regular device nodes. If it uses UUID for mounting, you still have to change to labels to make booting more predictable. Both NTFS and FAT does not support UUID, but they support labels. You then have to edit your boot loader config. By using labels for mounting, you can switch the drives all over with out creating problems. The following is an example of how to use labels for mounting and assuming linux-root is the main partition where Linux is stored.

LABEL=linux-root / ext3 defaults 1 2

Personally, I do not recommend dd or any sector to sector copy program for mirroring. It causes problems if the two drives are not the same.
The easiest way to switch is to just swap the drives and reboot. I don't think that was the point of these questions. Otherwise it's just too simple to warrant a question of this nature.

By the way, dd works quite well if you use a target drive or partition that is larger than the source. I did this myself recently to take a backup of my Linux installation on a USB drive.

If it's a question of merely swopping drives, here's the easiest procedure:

1. reconnect the drives to the appropriate master/slave IDE port on the motherboard.
2. reboot and re-install Windows on the master drive.
3. Use a Linux LiveCD to restore grub and modify the /etc/fstab on Linux to appropriate device Id.
4. Reboot and all is set (configuring GRUB will still be required once you boot into Linux on the hard drive).

I've done this before and the process is trivial at best, though explaining it is harder than actually doing it.

Somehow I got the impression that the OP wanted to switch the actual contents of the partitions, not merely the position of the drives. Otherwise why ask about reinstalling Linux?

Last edited by vharishankar; 07-08-2009 at 10:04 PM.
 
Old 07-08-2009, 11:51 PM   #9
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
OP: Go for the labels thing. To phrase what you need to do another way - use gparted to check or change the labels of each partition, and replace `/dev/whatever` with `LABEL=somelabel` in each relevant line of /etc/fstab. Afterwards, you should be able to swap the disks and boot without issue. If you mess up, just boot a live CD and fix that file.


Quote:
Originally Posted by harishankar View Post
The easiest way to switch is to just swap the drives and reboot. I don't think that was the point of these questions. Otherwise it's just too simple to warrant a question of this nature.

...

I've done this before and the process is trivial at best, though explaining it is harder than actually doing it.

Somehow I got the impression that the OP wanted to switch the actual contents of the partitions, not merely the position of the drives. Otherwise why ask about reinstalling Linux?
There's no need to condescend, either. Surely you asked a "stupid" question or two when you were new to this?
 
Old 07-09-2009, 12:05 AM   #10
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by karamarisan View Post
OP: Go for the labels thing. To phrase what you need to do another way - use gparted to check or change the labels of each partition, and replace `/dev/whatever` with `LABEL=somelabel` in each relevant line of /etc/fstab. Afterwards, you should be able to swap the disks and boot without issue. If you mess up, just boot a live CD and fix that file.




There's no need to condescend, either. Surely you asked a "stupid" question or two when you were new to this?
I wasn't condescending exactly. I was indicating that the misunderstanding on my side arose because the original question was probably worded more verbosely than I expected and as a result I formed a theory or conclusion about it without realizing the nature of the query. Sometimes we tend to read more into a question than what is asked. This is purely arising out of imperfections in human communication, error in understanding and of course gaps in knowledge.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
convert a slave drive back into a master drive rbees Linux - General 6 01-24-2008 08:23 AM
Problem with XP on master drive and Linspire 4.5 on slave jkdawson Linux - Software 7 01-10-2005 06:42 PM
master and slave drive - fc3 adkenc Linux - Hardware 1 11-23-2004 12:38 PM
Debian on master drive, now can I put a drive with W95 as slave? everest Linux - Software 0 07-03-2004 03:40 AM
What's the deal with Master/Slave drive? concoran Linux - General 7 03-30-2002 03:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration