Can I delete and reinstall Ubuntu 8.04 and keep a home partition?
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.
Can I delete and reinstall Ubuntu 8.04 and keep a home partition?
If I want to remove/reinstall Ubuntu 8.04 and still keep a home folder in a dedicated partition in tact what would be the simplest method? Can I just reformat the root and swap partitions then reinstall? I assume that only partitions that are empty and formatted will be used by Ubuntu when I reinstall, is this correct? Will I have to manually assign the root and swap folders to empty partitions on my HD?
I have read that having the home folder in a separate partition would make reinstalling Ububtu easier because I would be able to keep my settings. Since I haven’t installed Ubuntu yet I’m not sure what these “settings” are that I would keep in tact. I do know that my personal files live in the home folder so that would save some labor when I reinstall the OS. Before reinstalling I would of course back up all my files in the home folder.
Please note that I am talking about a dual boot situation with Windows 98 where I would remove and then reinstall Ubuntu. I am new to Linux. Thanks.
Boot from the cd, and do the manual partition, so you can keep the desired partitions, and reformat the others
make sure you know which is the home partition :-)
Firstly, make sure you know exactly which partition is which, by their device names (eg /dev/sda1 etc). When you get to the partitioning step of the installer, you have to choose the manual method.
Start with the root partition, look for the "use as" field, and select the filesystem you want to use. If you choose the same filesystem as what's already on the partition, you get the option to format or not format. Every partition aside from /home should be formatted in this case. Then you need to select the mountpoint, there should be dropdown menu with all the UNIX hierarchy directories on it. Select / and move on to the next partition. If you like, you can tweak the mount options also, I like to add "noatime" personally.
For /home, you need to make sure you select the same filesystem as the one which your /home partition is already formatted with. For formatting, you need to make sure you select "No, keep existing data". Then select /home from the mountpoint dropdown. Again, mount options are up to you, but generally noatime is the only one you should consider bothering to enable.
If you have an existing swap partition and don't want to change it, you can just ignore that partition's entry, it will be automatically formatted and used as the default swap partition.
Once you're ready, the next screen will give you summary of the changes, which partitions will be formatted, with which filesystem(s), and which will be used as-is. If there it says it's going to format your /home partition, make sure you go back and do not proceed. It's all pretty straightforward if you know the least bit about device names, mountpoints, and filesystems.
Thanks Lurko. That’s just what I was looking for. Your reply is as good as a tutorial. Plus you even threw in a performance tip.
I looked up atime and it does seem like something I could definitely do without. IIUC I read that Ubuntu uses something called reltime. In this article http://kerneltrap.org/node/14148 they say ”earlier in the thread it was claimed that Ubuntu is now defaulting to noatime+nodiratime, and has done so for several months.” If this is true (and I have no idea if it is or not) then why would we need to set noatime manually? This is all way over my head so if I don’t hear back from you I’ll just set it manually as you suggested. Thanks.
I suggested noatime because I had no idea that the Ubuntu installer would set it automatically. I'm quite certain there won't be any problems if you enable the options manually, but clearly it's not necessary for those options (at least with Ubuntu).
After installation, you can check what options are being used(and change them if you like) by reading the file /etc/fstab. The fourth field (fields are separated by white space) on each line contains the mount option(s) for that line's filesystem. Multiple options are comma separated, you should see something like noatime,nodiratime for your / and /home partitions, assuming both options are being used. If they're not present you can add them yourself, if you care to do so.
You can look at the fstab and mount manpages for more details on the fstab file and the mount options for various filesystems. I wouldn't bother looking at the mount manpage until you actually need to know about a specific filesystem's mount options though, unless of course you'd find it interesting or educational.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.