LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-26-2005, 09:50 AM   #1
qjimbo
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Rep: Reputation: 0
Moving Ubuntu installation to another drive


Hi,
I was wondering if someone could tell me step by step, how to move an ubuntu install to another harddisc? Is it possible to have it inside a folder on the other drive as well? I have no idea what the easiest way of doing this is and how to reconfigure grub for it.

The current drive it's on is /dev/hdb/ and I want to move it to /dev/hda prefereably inside a folder on that drive.

Thanks!

EDIT: I can still have a swap partition on /dev/hdb/ so thats not a problem

Last edited by qjimbo; 11-26-2005 at 10:27 AM.
 
Old 11-26-2005, 11:47 AM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,474

Rep: Reputation: 155Reputation: 155
"The current drive it's on is /dev/hdb/ and I want to move it to /dev/hda prefereably inside a folder on that drive."

You are moving from one partition to another. So let's assume that you are moving from /dev/hdb1 to /dev/hda1.

"I was wondering if someone could tell me step by step, how to move an ubuntu install to another harddisc?"

Log in as root.
Format /dev/hda1. If /dev/hda1 is mounted then you first umount the partition. Then use mkfs to create a new file system on /dev/hda1. Assuming that you want an ext3 filesystem:

umount /dev/hda1
mkfs -t ext3 /dev/hda1

Now copy everything in Ubuntu to /dev/hda1:
mkdir /newubuntu
mount -t ext3 /dev/hda1 /newubuntu
cp -R -p /* /newubuntu

Now change to run on the /dev/hda1 system:
chroot /newubuntu

Now you are working with the files on /dev/hda1
Edit /etc/fstab to change the location of / to /dev/hda1. If there is an entry for the old /dev/hda1 then remove it. You may want to add an entry to /etc/fstab for /dev/hdb1.

Edit grub by editing /boot/grub/menu.lst. Change the root line to hd0,0. Change the kernel line to root=/dev/hda1.

Then install grub on the MBR with:
grub-install /dev/hda
(note that you are installing the MBR to /dev/hda not to /dev/hda1.)

shutdown and reboot

------------------------------------
Steve Stites
 
Old 11-26-2005, 11:55 AM   #3
qjimbo
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for the reply! However dev/hda1 has lots of files on it in the root folder, so ideally I'd like to be able to move ubuntu into a folder on that drive, rather than onto the root. Is this possible? I want to sort of fool it into using a folder called 'ubuntu' on /dev/hda1 as if that's / or Am I asking for the impossible? I just don't really want to clutter up the root of the drive with bin, usr, var and all those folders as I'll be accessing this drive from another distro. It'd just be nice to keep it organized without having to partition.
 
Old 11-26-2005, 12:04 PM   #4
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,474

Rep: Reputation: 155Reputation: 155
"Thanks for the reply! However dev/hda1 has lots of files on it in the root folder, so ideally I'd like to be able to move ubuntu into a folder on that drive, rather than onto the root. Is this possible? I want to sort of fool it into using a folder called 'ubuntu' on /dev/hda1 as if that's / or Am I asking for the impossible?"

You are asking the impossible. You can copy ubuntu into a directory called /ubuntu but it would not be a runnable operating system.

What you can do is divide /dev/hda1 into two partitions, /dev/hda1 and /dev/hda2. Put your current files in one partition and copy ubuntu to the other.

I am going jogging so somebody else will have to continue this.

-----------------------------
Steve Stites
 
Old 11-26-2005, 12:11 PM   #5
qjimbo
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Okey dokey I didn't want to have to resort to doing that though, I thought this might be a nice solution to avoid partitioning.
 
Old 04-04-2011, 11:50 AM   #6
AncientIslander
LQ Newbie
 
Registered: Apr 2011
Posts: 3

Rep: Reputation: 0
---

Last edited by AncientIslander; 04-04-2011 at 12:31 PM. Reason: redundant
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving files from NTFS drive to a EXT3 drive?? webshark Slackware 10 05-28-2006 03:02 PM
Moving Ubuntu to a new HDD PaganHippie Ubuntu 14 09-29-2005 12:42 AM
moving /home to a new drive? tardigrade Linux - Newbie 5 10-18-2004 05:56 PM
Moving LFS to a new drive LinuxLuvr Linux From Scratch 7 08-03-2004 03:53 AM
moving to another drive? dittohead Linux - Hardware 4 07-07-2003 10:43 AM


All times are GMT -5. The time now is 11:38 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration