Re-partitioning a hard disk?

Asked by george_rutkay

Ok, I really really like this Ubuntu Linux and I haven't had to log-in to Windows for a while now. This is very functional!!

I've partitioned my hard drive into 4 pieces:

1) Win XP boot
2) NTFS document storage
3) Linux Swap
4) ext3

I want to swap drives with my home computer, repartition the drive so partition 1 and 2 become one big document storage place for me. I want to leave Linux as the only OS on this computer - it does everything I need and I don't think I need to do anything with Windows any more.

So I need to know, how can I:

1) migrate settings between Linux installations...

2) wipe and repartition the first two partitions into one and not lose Linux? The traditional partitioning tools always put data at risk but some of the more recent tools seem to have helped users modify their systems with minimal risk.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Jim Hutchinson
Solved:
Last query:
Last reply:
Revision history for this message
Best Jim Hutchinson (jphutch) said :
#1

Short answer is yes you can. However, I've not had good luck reclaiming the space in front of the linux partition. There may be a way to do this but honestly, I think backing up all your data and doing a nice clean install with well laid out partitions is the best way to go. It's very easy and you avoid the potential failure I had and left my partitions unusable and had to start over anyway.

This site will give you a good overview of your options.

http://www.psychocats.net/ubuntu/partitioning

Personally, I make 3 partitions. One for /home which holds everything I create including my settings. One for the install files and apps, and then the swap partition. Whenever a new release comes out I install a fresh copy but leave my /home alone. After the install I have the latest version, and all my settings are there. I do need to reinstall apps that didn't come with ubuntu like AV support and such but it only takes a few minutes so no biggie for me. You can just upgrade too but with /home on it's own partition you have more options.

If you want to try and just remove and resize partitions you need the gparted app. You will also need to run it from a live CD since it cannot work on mounted drives. Easiest way is to just boot the live Ubuntu CD, open a terminal and type gksudo gparted.

Welcome to Ubuntu. Hope that helps.

Revision history for this message
george_rutkay (yaktur) said :
#2

Thanks Jim Hutchinson, that solved my question.

Revision history for this message
george_rutkay (yaktur) said :
#3

I'll give it a try ASAP, I'll bring my work computer home and see how I can do this. Thanks!

Revision history for this message
Jim Hutchinson (jphutch) said :
#4

It's pretty straight-forward but if you need help post back. You can also get live help on any number of IRC channels. I'm on #ubuntu-colorado most of the day and there are others there willing to help. You don't have to live in Colorado to get help either. You can also see if there is a loco team in your area if you'd prefer.

https://wiki.ubuntu.com/LoCoTeamList

Revision history for this message
george_rutkay (yaktur) said :
#5

Thanks for the info - I'm in Canada.

I'm just thinking ahead now, what am I going to back up my MP3s on, there's about 3 GB worth of them and I'm not about to reload the CDs manually! I think I have a spare laptop drive at home, I should be able to hook it up and use it to back things up.

Revision history for this message
george_rutkay (yaktur) said :
#6

Oh, I've taken time to select which packages I wanted. Is there any kind of a system log which lists which packages I've installed and whether there are any special preferences/settings?

Can this personal setting/preference info be backed up onto a single CD?

Revision history for this message
Jim Hutchinson (jphutch) said :
#7

There is a way to log all that you have installed.

dpkg --get-selections | grep -v deinstall > ~/backup/installed-software.log

Creates a file with all installed packages - ALL packages even the ones that are part of Ubuntu. I don't know how to select just the ones you've added. To reinstall the packages run

sudo dpkg --set-selections < ~/backup/installed-software.log

Obviously you need to save that file somewhere :). It won't re-install apps that are already installed.

I don't know if this is a perfect solution or not. I know it won't save your settings. Your settings are all in your /home folder usually in hidden files and folders. Press ctrl-h to see them. You can save these file and folders and copy them back but I don't know if it's a fool proof thing or not. I've never tried.

Personally, I think the best approach is to backup everything important and then not worry too much about settings. I consider it a chance to "clean house" plus a chance to get some more practice with setting things up. That is not everyone's philosophy, however, so you can try and save all the hidden files.

As for backing up the MP3 and anything else you want to save you pretty much need another hard drive. You can also burn them to a DVD is you have a DVD burner. CDs would be a bit of a hassle I think since they don't hold much but if that's all you have then it will work too. You will just copy and burn the data files rather than making a music CD or something. If you have 3GB of MP3s they will fit on one DVD. An external HD is great for this kind of stuff but I will double backup important stuff like photos by putting it on a DVD and an external HD. There are also some online storage options but I've never tried them and even with broadband it could take a while to back up a lot of stuff.