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 09-28-2010, 12:30 AM   #1
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
How to create separate partitions for directories AFTER installing Linux ?


I want to create a separate partition for /home. LinuxMint is *already* installed. Can PartedMagic be used for the same, NOW ? Any other way out ?
 
Old 09-28-2010, 12:35 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
You can use every live-media that is using gparted (Parted Magic, GParted-Live-CD, etc.). Like every time when partitioning be sure to backup valuable data.
 
Old 09-28-2010, 12:41 AM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Original Poster
Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
So you mean while using PartedMagic, pre-installed Mint will not get effected ?
 
Old 09-28-2010, 12:42 AM   #4
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Hi,

Do this :
First list partition table using:

Quote:
sudo fdisk -l
Please search for free space using

Quote:
sudo fdisk /dev/sda
Quote:
Command (m for help): n
n-->create new partition

If you have free space it will show;then press twice and give size
Last cylinder, +cylinders or +size{K,M,G} (27599-30401, default 30401): +20GB

Quote:
Command (m for help): p
p--->to print partition table

Quote:
Command (m for help): w
w --->save and exit

Quote:
(Note at any point to exit without saving type

Command (m for help): q )
Now list partition table

Quote:
sudo fdisk -l
To inform the OS of partition table changes:

Quote:
sudo partprobe
Now suppose new partition is /dev/sda8 and you want to format it as ext3 then

Quote:
sudo mke2fs -j /dev/sda8
now to mount it as /home

Quote:
sudo /dev/sda8 /home
To list mounted filesystem

Quote:
df -h

mount
You can also use partition magic but i like doing it using fdisk
 
Old 09-28-2010, 12:44 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Original Poster
Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Thanks Prayag, but that sounds terrifying
 
Old 09-28-2010, 12:47 AM   #6
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Ya It requires practice but if you follow it as it is as i have given then you can do it very easily.You can practise it on any other system or virtualbox

also refer these two links:

http://www.howtoforge.com/partitioning_with_gparted

http://www.howtoforge.com/partitioning_with_gparted

Last edited by prayag_pjs; 09-28-2010 at 01:03 AM.
 
Old 09-28-2010, 12:59 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
I read somewhere (don't know where anymore) that it is not recommended to partition a disk from within an OS that is running on the same disk. Maybe this info is outdated, but I always use live-media to partition disks, and never had an issue with this. Backup is only recommended for worst case, but never had one. Do you have to resize the partition with Mint or do you have space enough to make a new partition? prayag_pjs way will only work with free space on the disk.

Last edited by TobiSGD; 09-28-2010 at 01:03 AM.
 
Old 09-28-2010, 01:07 AM   #8
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Thumbs up

Quote:
Originally Posted by TobiSGD View Post
I read somewhere (don't know where any-more) that it is not recommended to partition a disk from within an OS that is running on the same disk...
What if we using servers in Live Production Environment ?
 
Old 09-28-2010, 01:07 AM   #9
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Original Poster
Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
TobiSGD

Thanks to you !
I installed Mint yesterday, it didn't ask me for the directory partitions like /home, /root etc. Since it is dangerous to keep home and root on the same partition, I started this thread !
 
Old 09-28-2010, 04:18 AM   #10
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Original Poster
Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Even if I create partitions on my harddisk with GParted or PartedMagic, how would I land /home on it ??
 
Old 09-28-2010, 04:31 AM   #11
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
You mean to say you have data in /home and when you create a partition and mount it on /home ;previous data of /home will not be shown in new /home!

If it is so copy it to separate partition or backup drive,mount new partition on /home and copy the back-up data again in new final /home

When you create a new partition(below sda8 is an example ) format it using

Code:
mke2fs -j /dev/sda8
and mount it using

Code:
mount /dev/sda8 /home
Also make the entry in fstab to mount it permanently:

vim /etc/fstab

Code:
/dev/sda8  /home         ext3    defaults        1 2

Last edited by prayag_pjs; 09-28-2010 at 04:33 AM.
 
1 members found this post helpful.
Old 09-28-2010, 05:17 AM   #12
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Original Poster
Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Thanks again,

You mean /home now will be permanently moved and shifted to that partition from its original location ?

Can you provide some excellent links where I can read more about shifting and mounting directories to different partitions ?

Last edited by TheIndependentAquarius; 09-28-2010 at 05:18 AM.
 
Old 09-28-2010, 05:41 AM   #13
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Hi,

No it wont move existing /home to new /home ...you need to take backup and move that backup on new partition mounted on /home ...

When you create a new partition it has to be mounted somewhere to use ..

so we mount new partition on any directory we want ...

As u have home folder in / itself(as you dont have any other partition except / swap) when you mount new partition on /home (which is existing folder)its contents wont be shown.But when you unmount that partition you will get its content back.

You can refer this link

http://tldp.org/HOWTO/Partition/fdisk_partitioning.html

Last edited by prayag_pjs; 09-28-2010 at 05:42 AM.
 
Old 09-28-2010, 07:11 AM   #14
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Rep: Reputation: 113Reputation: 113
Just a note.
Its not really dangerous its just not recommend so that way if you root files system becomes corrupt you can still recover your data in your home directory. But also if you have data bases or any other data stored in var you may want to mount it seperatly as well. Personally in my opioion I would only do that on a mission critial system but that only a preference.

Im not sure how many systesm you are running but to help keep track it may be easier to label them as well like this

# tune2fs -L <yourlable> /dev/<yourHD>

Last edited by jmc1987; 09-28-2010 at 07:13 AM.
 
Old 10-04-2010, 05:57 AM   #15
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Original Poster
Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Thanks to all of you who responded, I have currently reinstalled Mint (on my external harddisk) and figured out how to create partitions during installation with Mint (Its installer does not follow the obvious path ). I shall consider whatever you said once I install Slack on the laptop.

Thanks again !
 
  


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
Mounting windows and Linux partitions on separate hard-drives vineet7kumar Solaris / OpenSolaris 1 10-09-2007 08:17 PM
Separate Partitions for Separate User groups volvic Slackware - Installation 2 09-16-2004 02:42 AM
Installing Linux and WinXP on separate partitions rosol11 Linux - Newbie 5 06-26-2004 06:11 AM
Create software RAID partitions first, then create filesystem partitions on top of th stefanlasiewski Linux - Software 1 04-28-2004 04:12 PM
How can I access both /home directories on separate HHDS? estatik Mandriva 1 12-08-2003 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:53 PM.

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