LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-29-2011, 02:44 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
Correct way to delete and create again new home partition ?


hi,
I am using Cent OS 5. I want to know the steps to delete my home directory and then again mount it.
Steps which i perform is

1- Delete /home portition entry in fstab
2- Unmount the partition.
3-Use Fdisk to delete the partition.

Technically i does not know that these steps are correct or not.For create again then should i do following steps

1- use fdisk and create new partition
2- Format the partition.
3-Make a folder with name "home".
4-Mount that folder to the new created partition.


kindly guide me,
thanks
garden
 
Old 08-29-2011, 02:54 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,688
Blog Entries: 23

Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Quote:
1- Delete /home portition entry in fstab
2- Unmount the partition.
3-Use Fdisk to delete the partition.
Noooooooooooooooooooooooooooooooooooooooooooo...



You're getting in way too deep.

A home directory is NOT the same as the /home partition. If you're going to mess with the partitioning, be warned: have lotsa valium around

What I suggest is rename the old folder, create a new one with the old name and in there create the required folders (Pictures, Document, Downloads and what have you) or ... much better:

- make a backup of the user folder
- delete the user
- delete the folder if it's still there
- make a new user with the old name and settings

DO NOT mess with the partitions, for your own sake!

Wellness, I'll keep this thread on my scope to help further

Thor

Last edited by ButterflyMelissa; 08-29-2011 at 02:56 AM.
 
Old 08-29-2011, 02:59 AM   #3
nooneknowme
Member
 
Registered: Feb 2008
Location: Bangalore, India
Posts: 69

Rep: Reputation: 5
Hello,

I would first like to ask you ... why you need to recreate /home ?

I would first check if there are any users having their home directory in /home. Assuming there no NIS/LDAP running.
Quote:
grep "/home" /etc/passwd
you can always create a new mount point and point your home directory to it
Quote:
usermod -d /home1/user1 user1
regarding your steps ...


1- Delete /home portition entry in fstab - Not required, because you will eventually mount it again.
2- Unmount the partition.
3-Use Fdisk to delete the partition. - Perhaps you can just use the same partition and just reformat it using mkfs

Technically i does not know that these steps are correct or not.For create again then should i do following steps

1- use fdisk and create new partition - Not required
2- Format the partition. - As step 3 above
3-Make a folder with name "home". - The folder will already exist
4-Mount that folder to the new created partition. - It is mounting the partition on the folder ... "mount -a" will do the trick, because the entry exists in fstab
 
Old 08-29-2011, 04:28 AM   #4
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks for the reply. Actually i am i am doing all these in on of my free system for my own practice.Following are the steps which i take.

Kindly review it and check where i am wrong.
thanks
garden
Attached Thumbnails
Click image for larger version

Name:	error.JPG
Views:	9
Size:	53.9 KB
ID:	7910  
Attached Files
File Type: txt deleting Partition.txt (8.2 KB, 9 views)
 
Old 08-29-2011, 04:37 AM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,688
Blog Entries: 23

Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Quote:
of my free system for my own practice
...okay...you got me on the run wow, good one...phew

Okay..the error message means that fsck cannot find the /home partition...I suspect you (already) deleted it. It's possibly still in the fstab, but not on the drive anymore.

Okay. Now on to the rebuilding of the partition.
Find out how much space you've still got. Then, fire up GParted (live CD?) and set up a partition in there.

I'll fire up a testbox here to re-create what you're doing, this looks like fun!

By the way, if you re-partition the disk externally (Live CD) you may need to rebuild the Fstab entries...

By the way: excelent of you to practive this on a test system! Good for you!

Thor

Last edited by ButterflyMelissa; 08-29-2011 at 05:14 AM.
 
Old 08-29-2011, 04:55 AM   #6
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
kindly check the txt file as will in my previous post.
thanks
garden
 
Old 08-29-2011, 05:18 AM   #7
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,688
Blog Entries: 23

Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Hmmm...the text looks okay...

But...if erasing data is what you're after, a simple mkfs should suffice, I think.

But, all in all do-able, at a first glance.

Still, my opinion may differ...

Thor
 
Old 08-31-2011, 10:45 AM   #8
vivanguarda
Member
 
Registered: Sep 2008
Location: RJ-Brazil
Distribution: Slackware
Posts: 181

Rep: Reputation: 5
Look at this tutorial


http://http://www.linuxquestions.org...eeze_for_Linux

Last edited by vivanguarda; 08-31-2011 at 10:48 AM.
 
  


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
Can I delete and reinstall Ubuntu 8.04 and keep a home partition? win_to_lin_migrant Ubuntu 4 01-18-2009 01:56 PM
unable to create or delete files on fat32 partition Barrett Linux - Newbie 9 12-21-2005 05:19 PM
Create a /home partition. Michael Johnson Linux - General 3 07-06-2005 11:09 AM
delete and create a partition from a terminal gjo Linux - General 8 06-14-2005 02:49 PM
Create a partition for /home FiveFlat Linux - Newbie 5 05-02-2005 06:40 PM


All times are GMT -5. The time now is 03:54 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration