LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 09-07-2007, 05:01 PM   #1
mcbenus
LQ Newbie
 
Registered: Feb 2007
Posts: 24

Rep: Reputation: 15
Gparted for a new partition


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.

Thanks a lot (in advance)
BK
 
Old 09-07-2007, 05:03 PM   #2
Bariton
Member
 
Registered: Jul 2006
Location: Schloß Holte-Stukenbrock
Distribution: (B)LFS 6.2.0
Posts: 42

Rep: Reputation: 15
You have to add an entry in /etc/fstab where you define that the new parition should be mounted to /home.

For example:
Code:
/dev/hdc1      /home          ext3     defaults,exec                       0  0
 
Old 09-08-2007, 12:57 AM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
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
 
Old 09-09-2007, 08:01 AM   #4
mcbenus
LQ Newbie
 
Registered: Feb 2007
Posts: 24

Original Poster
Rep: Reputation: 15
Should I use disklabel?

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!
 
Old 09-09-2007, 08:19 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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
Code:
cp -aRx /home/ /mnt/newhome
cp -aRx /home/.?* /mnt/newhome
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.

Good Luck!
 
Old 09-09-2007, 02:09 PM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
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.
 
Old 09-09-2007, 02:40 PM   #7
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
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.
 
Old 09-09-2007, 07:03 PM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 09-09-2007, 07:12 PM   #9
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: Debian Wheezy
Posts: 2,839

Rep: Reputation: 48
Here ia an old article on how to move a partition.
 
Old 09-09-2007, 07:59 PM   #10
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Quote:
Originally Posted by 2damncommon View Post
Here ia an old article on how to move a partition.
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.
 
Old 09-09-2007, 08:37 PM   #11
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: Debian Wheezy
Posts: 2,839

Rep: Reputation: 48
Quote:
Originally Posted by Junior Hacker View Post
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.)
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error trying to resize NTFS partition with Gparted mistere29 Linux - Newbie 6 06-14-2009 05:20 PM
Problems detecting Windows NT partition in gparted, cfdisk zach014 General 5 06-15-2007 09:10 PM
redimension a ntfs partition using gparted htamayo Linux - Software 1 04-12-2007 10:55 AM
gparted destroyed partition table orionp31 Linux - Newbie 5 02-04-2007 10:33 PM
error resizing NTFS partition with gParted live CD Nived87 Linux - Newbie 5 05-29-2006 01:53 AM


All times are GMT -5. The time now is 05:42 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