UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ...
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
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.
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.)
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
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.
@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?
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.