Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hi - I am a new user, please help.
I am using Gparted liveCD to create a new partition (/home). I think I understand how to make space for it (I can shrink my /usr), and I can add a new ext3 partition. What should I do next:
1) How do I tell it that it is /home?
2) what does Device = > disklabel do? (I am getting a scary warning that everything will be deleted on dev/hda).
I looked at the gparted documentation but didn't find clear enough answers to my problem.
Go ahead and create the partition and format it in ext3 format. Boot into Linux, then you'll have to move all files and links from your old /home to the new one and add a line in /etc/fstab to mount it automatically every boot. Instructions below after partition is created:
Code:
1: #mkdir /mnt/newhome
2: #fdisk -l (to find device name of partition)
3: #mount -t ext3 /dev/???? /mnt/newhome (replace check marks in /dev/xxxx as per output of fdisk -l command)
4: #cd /home
5: #cp -ax * /mnt/newhome
6: #cd /
7: #rm -fr /home
8: #umount /mnt/newhome
9: #mv /mnt/newhome /home
10: #vim /etc/fstab (edit /etc/fstab with favorite editor if not vim, and add line below with proper /dev/xxxx)
11: /dev/???? /home ext3 defaults 1 2
12: re-boot
Thanks for your answers. One thing I want to clarify - On Gparted, after shrinking my /usr partition, and defining a new ext3 partition, do I need to do anything else? specifically, do I need to use 'disklabel'?
Thanks for the detailed code!
Some distro's use labels and some don't. However, you don't need one if you will use a device name like /dev/hda3 rather than something like "LABEL=home".
You may want to use
to copy the contents of the old home contents to the new home contents. The first line also has the -R option to recurse subdirectories. The second includes any hidden files. This probably won't be necessary unless you copy from inside your own home directory. Some directories and in your home directory are hidden, and contain configuration information, such as ~/.profile & ~/.kde/
To be able to write to the new directory and copy other user's home directories, you need to do it as root. If you are a normal user, su to root first or precede the command with sudo.
The (-a) in (-ax) will copy everything recursively and hidden, preserve ownership, timestamp, and preserve links. As in step 4, you are instructed to change into the home directory first, the instructions are adequate. Below is an extract from the cp manual pages or man pages:
Code:
-a, --archive
same as -dpPR
Last edited by Junior Hacker; 09-09-2007 at 02:13 PM.
There was a thread in the past where someone had issues where their swap was not being resumed upon re-boot in Fedora 7. For some reason the installer apparently had "Label=swap" or similar, another person suggested changing it to /dev/xxxx. I posted my /etc/fstab which was constructed by anaconda that had /dev/xxxx rather than "Label=swap". The original poster was able to have the kernel resume swap by changing it to /dev/xxxx, based on that, it appears to be the better option in Fedora. I sometimes wonder if the OP was telling the truth about anaconda constructing it that way.
I missed the "R" part of the -a option. It won't copy hidden directories or files from the same directory however. ( As in "cp -ax /home/user1/* /mnt/newhome/" ) This is due to file globbing rather than command options. But is is unlikely that the OP has any hidden files or directories in /home/.
But any hidden files or directories will probably be inside a regular directory like /home/user/ so then it will be copied.
Looks exactly like one of the tuts I originally settled on, I did try different tuts with different commands at the crucial step #5, this is the one that works. I revised my instructions knowing this works by deleting the original /home and editing /etc/fstab right off the hop rather than after a re-boot, because if you get errors in step #5 means you don't have your syntax quite right, but if it executes without errors it was successful. I don't remember step #4 from this tut in the Gentoo tut I used which is either a re-make of this one, or this one is a re-make of the Gentoo tut, but it's a good step to include. I'll ponder changing my instructions to include it, more than likely will add it.
The instructions I posted are just notes I kept for myself originally in case I need to do it again. But because of ntfs-3g, it's unlikely I'll ever have home on a separate partition again as I prefer to use a shared ntfs partition with unlimited file size for data. I created two 60GB files just the other day. And it's better for me to have my Linux installation fully self contained in one partition for ease of backup, only one partition needs to get imaged, (compressed, without un-allocated space), and if user files in /home or wherever do get corrupt, restoring the image is only a couple minutes. And I won't get denied access to user accounts that "sometimes" happens when one shares /home partition with more than one installation.
On another note:
BTW: jschiwal, I've been pushing your virtual test of making images of partitions with dd while eliminating un-allocated space, it took a while before someone was brave enough to try it (or bright enough to understand it), and it received the two thumbs up.
Looks exactly like one of the tuts I originally settled on, I did try different tuts with different commands at the crucial step #5, this is the one that works. I revised my instructions knowing this works...
I prefer to direct link to articles and instructions if they are still available as it makes for a short and simple post and illustrates the issue is common to the poster. I link the "IBM: Moving Home" article every chance I get. (Not as often as I link the Linux is not Windows article.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.