Hi again,
I've installed Linux Mint Fluxbox CE yet on another computer. But for testing I've put it on a secondary IDE hard disk (sdb). Now after two weeks of testing and no problems at all, I'd like to have it on the primary IDE (sda) and remove the "sdb" from the computer. Is there a way without having to install the system again, having to download the updates and additional software that I installed and configuring everything again?
Basically what I'd have to do is to create an ext4 and swap partition on "sda". Then copy the complete root file system from "sdb" to "sda". Then somehow I'd have to generate a new "fstab" and reinstall/reconfigure "grub" so that it points to "sda" instead of "sdb".
Has anyone done such a thing already?
Moving OS to another hard disk
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Moving OS to another hard disk
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Moving OS to another hard disk
Yes, kinda, but it's rather cumbersome and pretty much noone recommends it. The best way is to reinstall the system, but (if it exists on the fulxbox version) you can use apt-on-cd to store all of your updates so they don't have to be re-downloaded.fluxalex wrote:Hi again,
... Is there a way without having to install the system again, having to download the updates and additional software that I installed and configuring everything again?...
Almost all configuration is in your /home/<user>/ directory, and most of it can be copied directly onto a new system, when I update, I just keep all of my /home stuff (by putting it on a seperate partition) however you should be able to copy files w/o notable problems. The terminal command "ls -al" will list all files in a directory (so open a terminal, cd to ~/ which is home, and ls -al) however you'll have to use "show hidden files" in your file manager to do that using a graphic enviornment's tool. I hope that makes sense.
Yes, that has been done, exactly as you say, but I felt the need to repeat that I, and most that I talk to, don't do that and call it a "bad idea".fluxalex wrote: Basically what I'd have to do is to create an ext4 and swap partition on "sda". Then copy the complete root file system from "sdb" to "sda". Then somehow I'd have to generate a new "fstab" and reinstall/reconfigure "grub" so that it points to "sda" instead of "sdb".
Has anyone done such a thing already?
If you don't understand something, ask, I'll be sure to check back.
Re: Moving OS to another hard disk
Whether you go for migrating your installation or reinstalling, IMO, depends on how confident you are in fixing a broken system. If something does go wrong, you will have probably saved a lot of time and stress by just reinstalling. Like ArcherSeven says, after reinstalling you can copy over your files to keep all your documents and settings, etc. [Self promotion ahead ] I wrote a small guide on how to migrate your data from one machine to another, but it will work just as well from one drive to another. You'd be interested in the rsync bit.
http://drsjlazar.blogspot.com/2009/12/t ... puter.html
To avoid downloading all those upgrade packages again, you could copy over the packages from the apt cache in /var/cache/apt/archives/ (unless you have cleaned the cache), add the PPAs if you need to and install using the package manager... They will not be downloaded again if they are in the apt cache.
But if you are feeling ambitious, this might be helpful: http://bbs.archlinux.org/viewtopic.php?pid=723648
http://drsjlazar.blogspot.com/2009/12/t ... puter.html
To avoid downloading all those upgrade packages again, you could copy over the packages from the apt cache in /var/cache/apt/archives/ (unless you have cleaned the cache), add the PPAs if you need to and install using the package manager... They will not be downloaded again if they are in the apt cache.
But if you are feeling ambitious, this might be helpful: http://bbs.archlinux.org/viewtopic.php?pid=723648
Blog: http://drsjlazar.blogspot.com
Twitter: http://twitter.com/drsjlazar
Shared Stories: http://www.google.com/reader/shared/drsjlazar
IRC: shan3
Twitter: http://twitter.com/drsjlazar
Shared Stories: http://www.google.com/reader/shared/drsjlazar
IRC: shan3
Re: Moving OS to another hard disk
I'm back, now from the other disk
Here is a link referring to almost the same problem:
http://forums.linuxmint.com/viewtopic.p ... 89&start=0
After creating the partitions on "sda", I rebooted from CD and used these commands:
Then, since I was not sure, I manually edited the "new/etc/fstab" file - don't know if that was necessary?
But "grub" is a pain, rebooting didn't work, so I went here...
http://grub.enbug.org/Grub2LiveCdInstallGuide
...and entered these...
Now I'm happy
Here is a link referring to almost the same problem:
http://forums.linuxmint.com/viewtopic.p ... 89&start=0
After creating the partitions on "sda", I rebooted from CD and used these commands:
Code: Select all
mkdir old
sudo mount /dev/sdb1 old
mkdir new
sudo mount /dev/sda1 new
sudo cp -rp old/* new
sudo grub-install --root-directory=new/ /dev/sda
But "grub" is a pain, rebooting didn't work, so I went here...
http://grub.enbug.org/Grub2LiveCdInstallGuide
...and entered these...
Code: Select all
sudo fdisk -l
sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
(optional, only if you're on Ubuntu/Debian) apt-get install grub-pc
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda (try grub-install --recheck /dev/sda if it fails)
Ctrl+D (to exit out of chroot)
sudo umount /mnt/dev
sudo umount /mnt
Re: Moving OS to another hard disk
If you have to do this again, there's a live CD called Parted Magic that can clone partitions.
m a r
m a r
Re: Moving OS to another hard disk
I have that CD - Version 4.9. But since the partitions are not the same size in fact it is not exactly cloning, but migrating and I'd have to resize before or after and there is still the swap partition. I spent the most time dealing with "grub", otherwise it would've taken me not much more than half an hour. And going deeper into Partition Magic I would've spent more time. Has it the feature of adjusting "fstab" and "grub" automatically? If it has, then I'll use it next time
Re: Moving OS to another hard disk
You could also use clonezilla. It's good for cloning partitions.