LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-24-2011, 04:56 PM   #1
xmfclick
LQ Newbie
 
Registered: Mar 2007
Location: London
Distribution: Ubuntu
Posts: 7

Rep: Reputation: 0
Move installation to other hard disk


Let me start by saying that I'm not very familiar with Linux systems, though I now use Ubuntu, but I've used Windows for years, so I still see things in a Windows-centric way. Please don't blind me with Linux science -- I need things kept simple.

So, in the old days my PC was running Windows with a small-ish hard disk but I added a bigger one, which I kept my data on -- C: for Windows, F: for data. Then, for various reasons, I installed Ubuntu; but the install somehow got onto the F: disk. I had another go at installing it and ended up with a second install on the F: disk, in another partition (I was having a bad day). Well, at that stage I stopped re-installing it, and just went with one of the Ubuntu's. Anyway, this is what my system looks like now ...

Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             150G   14G  136G  10% /media/C-DRIVE
/dev/sdb1              13G   11G  1.6G  88% /media/windows-test-install
/dev/sdb5             200G  124G   76G  63% /media/F-DRIVE
/dev/sdb6             7.0G  4.4G  2.3G  66% /
/dev/sdb8              14G  3.4G  9.0G  28% /media/4a1de0fa8bf00cd7
What I want to do is move the Ubuntu install that I actually use (the sdb6 one) onto sda (as sda2?), get rid of the sdb8 Ubuntu install, and release sdb6 & sdb8 back to the sdb5 partition. Then I'd like to point my home directory at the sdb5 partition at startup. For a seasoned Linux user this should be a piece of cake, but for me it's daunting. Can anyone help me, either with instructions here or somewhere out on the Interweb. (I've spent ages Googling but nothing I found was down at my level.)

Thanks in anticipation.

Last edited by xmfclick; 11-24-2011 at 05:00 PM. Reason: Spelling error
 
Old 11-24-2011, 08:29 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
There's a number of ways to go about this.

If your Ubuntu installation is not particularly customized, then perhaps the 'simplest' approach would be to (in overview):

0. Make sure you have backups of everything. A power failure or mistake in the middle of rearranging partitions can make data inaccessible.

1. Install a new Ubuntu onto sda. The Ubuntu installation has a partition editor that will allow you to organize the sda partitions in the way you want. You are probably already using grub as the boot loader on sda; if not, the Ubuntu install will place it there and set up the multi-boot configuration.

2. Change your home directory to point to the directory in sdb5 (this requires editing /etc/fstab, and copying across any home folder files from sdb6 that you wish to retain). You may be able to do this during the Ubuntu install in the previous step, but you'd have to be careful you don't format sdb5 in the process. Be aware that even new user directories have hidden files and directories (starting with '.') that are useful.

3. Test out the new install

4. Remove and rearrange partitions on sdb using a partition editor such as gparted.

5. Reconfigure grub so that it removes the entries for the old install of Ubuntu.

If you really must mirror the install, the procedure involves more manual steps, and it would be helpful to be familiar with the Linux command line interface.

I should also note that sharing a home folder with Windows is not necessarily desirable (if only because it would be an advantage to use a non-NTFS filesystem for Linux, and Windows doesn't play well with ext filesystems. You could more easily just mount the shared partition inside the Linux home directory (for example as a 'shared' folder or something like that), and just keep the Linux /home on sda.

Last edited by neonsignal; 11-24-2011 at 08:36 PM.
 
1 members found this post helpful.
Old 11-25-2011, 01:46 AM   #3
xmfclick
LQ Newbie
 
Registered: Mar 2007
Location: London
Distribution: Ubuntu
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy

Thanks, neonsignal. Yes, I considered doing all that but my Ubuntu installation is now customised (to look quite a lot like Windoze) and I've downloaded a fair few applications too, so it would be a ton of work to re-create the current setup from scratch.

Being very old, as I am, I remember the DOS command prompt with a certain wistful affection, so the Unix command line isn't particularly terrifying. However, what *is* is the gobbledygook that comes out when I look at a man page. That's where I need advice and guidance. You *nix experts tend to say things like "Reconfigure grub so that it removes the entries for the old install of Ubuntu" as if it's dead simple (which I'm sure it is, once you know what you're doing), but to us Linux newbies it's actually rather opaque and difficult.

So, if I could prevail on you again, how would you go about things as per Plan A? (except that yes, I did actually mean mounting my own home directory as the second disk, under /home -- my bad.)

Thanks!
 
Old 11-25-2011, 03:12 AM   #4
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Actually moving an install to another disk is not that tough. I do it quite often.

I use gparted. You should do this from a LiveCD so that no drives are mounted. You just cut and paste the partition(s) to where you want them.

Obviously you may need to do some tinkering you your grub. This can be done with the Live CD using these instructions;
https://help.ubuntu.com/community/Gr...stalling_GRUB2
You should not need to edit any files just install the bugger on the MBR and run "update-grub" if that is the install you want running your grub files.

Used to be that you needed to edit the /etc/fstab file so that the / partition could find the /home partition if you were installed on 2 partitions (a very good idea). Since moving to uuid to identify the partitions instead of defining there position this is not needed as the uuid is transferred with the partition(s).

The exception to this, if you turn off one drive to go to the next, would be the swap partition but that would be easy and fast to move to the same drive as the install too.
 
Old 11-25-2011, 03:37 AM   #5
xmfclick
LQ Newbie
 
Registered: Mar 2007
Location: London
Distribution: Ubuntu
Posts: 7

Original Poster
Rep: Reputation: 0
@widget : Thanks, I followed that, right up to this bit ...
Quote:
Used to be that you needed to edit the /etc/fstab file so that the / partition could find the /home partition if you were installed on 2 partitions (a very good idea). Since moving to uuid to identify the partitions instead of defining there position this is not needed as the uuid is transferred with the partition(s).

The exception to this, if you turn off one drive to go to the next, would be the swap partition but that would be easy and fast to move to the same drive as the install too.
Does this mean that I can just cut and paste my sdb6 as, say, sda2 and grub will automagically spot it and include it in its list of operating systems at boot time?

Also, should I create a Linux swap partition on sda?
 
Old 11-25-2011, 11:18 AM   #6
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
You can cut and paste using a LiveCD to another drive. You will need to use the link that I gave for "grub recovery" to run update grub in the pasted install.

If you have another Linux install on the target drive, that is already handling the boot loader chores on that drive all you need to do is boot to it and run, as root;
Code:
update-grub
that should pick up your newly moved install.

If nervous of this move you could also copy/paste instead of cut/paste. This will mean you have two installs of the same system but you can always delete the one on sdb when you are sure the new one is working.

You will need, in either case, to have the size of the partition that you are pasting the same or slightly smaller than the area you are pasting it too. This is easily done by resizing with gparted before you do your move.
 
  


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
[SOLVED] Move centos to another hard disk? windstory Linux - Newbie 7 06-05-2010 09:00 AM
Move OS to Another Hard Disk k_oudom Linux - Software 22 10-10-2009 12:51 AM
Hard Disk Failure: How do I move data to a new hard disk drive? spyros Linux - Software 2 10-31-2008 03:01 PM
move mbr to different hard disk taiwf Linux - Hardware 4 08-11-2005 09:58 PM
Move hard disk with OS te_conway Linux - General 1 03-12-2002 09:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:18 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