LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-12-2014, 08:21 PM   #1
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 754

Rep: Reputation: 156Reputation: 156
already got 4 primary partitions


Hi,

Brief history: I have 3 HDDs on my PC. sdb contains Centos6, sda is my old backup drive (soon to become Centos7 - I want to be able to dual boot), sdc is my new backup drive.

Quote:
Filesystem Size Used Avail Use% Mounted on
/dev/sdb5 8.2G 4.5G 3.3G 58% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
tmpfs 947M 144K 947M 1% /dev/shm
/dev/sdb1 243M 125M 106M 55% /boot
/dev/sdb2 1.8T 173G 1.6T 11% /home
/dev/sda1 1.8T 1.4T 337G 81% /mnt/extend
/dev/sdc1 2.7T 1.4T 1.2T 54% /data
none 0 0 0 - /proc/sys/fs/binfmt_misc
The /home partition on sdb is huge and contains my samba shares. I want to move them out of this partition so that they will be visible to Centos7. My original plan was to resize the /home partition and create a new partition for general use/samba shares. But, I already have 4 primary partitions on sdb.

Quote:
Number Start End Size Type File system Flags
1 1049kB 263MB 262MB primary ext4 boot
2 263MB 1982GB 1982GB primary ext4
3 1982GB 1991GB 9227MB primary linux-swap(v1)
4 1991GB 2000GB 9100MB extended
5 1991GB 2000GB 8913MB logical ext4

I am using gparted. Are there solutions where I can add an extra storage area to sdb2 without having to reinstall centos6? From a quick poke around the net I should be able to create an extended partition? But gparted won't let me add anything to sdb2.

I suppose if all else fails I can resize the sda partition to contain the samba stuff. Then slice 'n' dice the rest of sda when I install centos7.

Cheers
 
Old 08-12-2014, 08:39 PM   #2
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
You already have an extended partition with one logical partition (/dev/sdb5).. Unfortunetly, you can not do anything with /dev/sdb2.. All logical partition need to be in the extended space, which in your case can't be expanded because of your swap partition (/dev/sdb3)... In theory, you could delete sdb2 and sdb3.. Then extend your extended partition to cover the newly free space and subdevide that space however you like, but that would also mess with the device names of your partitions.. I'm also unsure that gparted or any other partition manager could handle that.. Actually, I even had a problem with fdisk handling blank space of an extended partition before an actual logical one..
 
Old 08-12-2014, 08:46 PM   #3
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 754

Original Poster
Rep: Reputation: 156Reputation: 156
I just had a thought. How about, after I install Centos7, I create a mount point which mounts sdb (this drive being unused in Centos7)? I can then reference the shares from the mount point.

Should I need to boot into Centos6 the current fstab defines the relevant locations.
 
Old 08-12-2014, 08:48 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,348

Rep: Reputation: Disabled
Rezising the /home partition (/dev/sdb2) will create free space between /dev/sdb2 and /dev/sdb3. You cannot create a new primary partition from that space since you already have 4 such partitions, and you cannot directly use the free space for a logica partition either, because logical partition can only use the space allocated to the extended partition (/dev/sdb4).

You could probably use a partitioning tool to move /dev/sdb3 to start immediately after the shrunk /dev/sdb2 partition and then move/resize /dev/sdb4 to make it take up all the remaining space.

Another option would be to put the swap partition elsewhere and delete /dev/sdb3. You could then create a new /dev/sdb3 partition to hold your Samba shares.

This is precisely why people use LVM. If all the disk space was allocated to an LVM Volume Group, you could grow and shrink existing Logical Volumes to your heart's content, as well as create any number of new Logical Volumes as long as there's free space in the Volume Group.

And yes, you could obviously just mount the partition directly from CentOS, as long as you don't mind file owners and groups getting slightly mixed up.

Last edited by Ser Olmy; 08-12-2014 at 08:50 PM.
 
1 members found this post helpful.
Old 08-12-2014, 08:55 PM   #5
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Well, I've just re-read your first post.. Basically, if you just want to install CentOS and dual boot, you don't need to repartition anything.. Every partition will be accesible to you from CentOS7

You can just mount it as /myotherhome (or whatever you like) and point samba to those shares.. Or even use /dev/sdb2 as your /home (but I wouldn't recommend that, specially with the same username -- otherwise fine)
 
1 members found this post helpful.
Old 08-13-2014, 05:54 PM   #6
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 754

Original Poster
Rep: Reputation: 156Reputation: 156
thanks for the feedback. I'll just accept that I didn't think through my original partitioning. I'll play around with different partitioning methods in VirtualBox before I go any further. I'll need to read up on LVM first as I am not familiar with this.

Cheers
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change primary partitions to logical partitions AND migrate their data? chickenlinux Linux - Hardware 10 04-04-2010 05:31 PM
Primary partitions Gins General 23 03-20-2008 05:16 AM
4 primary partitions? sycamorex Linux - Hardware 13 06-04-2007 02:52 AM
Can you have more than 4 primary partitions? lyonsd Linux - General 3 06-06-2005 01:08 AM
four primary partitions? linuxtesting2 General 6 05-04-2004 11:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:06 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
Open Source Consulting | Domain Registration