LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-22-2016, 09:09 AM   #1
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Rep: Reputation: Disabled
Question changing partition scheme


Hi
Please first check the attached image.
As you can see that I have:
Quote:
sda1 and sda2 as primary
sda3 extended
sda5, sda6 and sda7 as logical
sda1 contain some recover tools and Windows 7 is installed on sda2. But now I want to complyetely remove windows. For this purpose I want to delete sda1 and sda2. Hence making sda5 as primary.
But the problem is that sda3 is extended which contain logical drives. I will use gparted for this pupose, but there is a danger of unbootable system, if I try to make changes in drive order.
So please give me some suggestions that how can i achieve that. I want following new partition scheme:
sda1 as primary (swap) (currently sda5)
sda2 as extended
sda5/6 as logical (for / and /home)
Regards
Attached Thumbnails
Click image for larger version

Name:	gparted.png
Views:	19
Size:	75.6 KB
ID:	23350  
 
Old 10-22-2016, 09:31 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
It is better to use UEFI - if possible.

If this is not possible, then change your partition scheme as follows:

Remove sda1 and sda2.

Then increase sda3 to the limit of fomerly sda1.

Do you have a magnetical hdd or a ssd?

Then use this partiton scheme:

/boot
swap
/(root)
/home
/var
/tmp

Might be better to do a complete reinstallation.
 
Old 10-22-2016, 09:38 AM   #3
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
What about changing sda3 to primary?
What about reinstallation of grub?
 
Old 10-22-2016, 09:49 AM   #4
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
Changing sda3 to primary won´t work, since sda3 is a extended partition and contains sda5, sda6 and sda7.
 
Old 10-22-2016, 09:55 AM   #5
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keruskerfuerst View Post
Changing sda3 to primary won´t work, since sda3 is a extended partition and contains sda5, sda6 and sda7.
Chance of data loss. Seems dangerous...
 
Old 10-22-2016, 09:58 AM   #6
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
I have one more strategy in mind:
resize sda1 and sda2 to 100 mb each
resize extended drive
move / to the begining
add the space to /home
reinstall grub

what do you think now?
 
Old 10-22-2016, 11:11 AM   #7
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
You can delete sda1 and sda2.

/boot at the begining and should have a size of 1GB.
Then swap with 1,5 x RAM size.
 
Old 10-22-2016, 11:19 AM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,504

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
If you just want the space now used by windows it would be simpler to just delete sda2 and resize sda1 to include what was sda2 then format it and create a mount point as well as an entry in fstab for that data partiton.

If you delete the current swap partition on sda5 and create another swap on sda1, then your root filesystem and /home partitions will change from sda6 to sda5 and sda7 to sda6. It would have been pretty simple to do if your swap was sda7, just turn swap-off and create the new swap.
When a logical partition is deleted, any logical partition with a higher number drops down one number.

If you move the boot files, you may have an unbootable system as mentioned in GParted. You would have to run grub-mkconfig or update-grub and then it might work. Not sure why you want to change the partitions. I would be much simpler to just create a data partition or two.
 
Old 10-22-2016, 11:29 AM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Why don't you just create a new sda1 and sda2 with the same sizes as your current sda6 and sda7? Then you could clone those logical disks to the new partitions (SystemRescue's fsarchiver program would do the job). You could then destroy the extended partition, because it would no longer contain anything unique.

To boot your new partitions, you would have to update your bootloader, but you could do that by chrooting from the SystemRescue disc.
 
Old 10-22-2016, 12:54 PM   #10
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
I have migrated swap from sda5 to sda1 with 2GB size
sda2 is resized to 100mb and mounted on /useless
now planning (tomorrow) to resize extended /dev/sda3 sda6 and sda7

disk clonning is a good option, but i will first try it in virtualbox, if it goes well then to my real system.

Thanks a lot
 
Old 10-22-2016, 12:56 PM   #11
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Yes, I know that i can mount these drives under my existing installation, but i am not habitual to do that. I have the habbit to keeping all personal data under /home single partition.
 
Old 10-22-2016, 08:04 PM   #12
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Assuming GRUB is already pointed to the sda7 partition, it is safe to use gparted to remove sda1 and sda2, and then resize sda3 to expand to the full space. The basic steps would be:

1) Edit /etc/fstab to comment out the swap entry.

2) Boot to a liveCD or USB.

3) Run gparted

4) Delete sda1 and sda2

5) Move/resize sda3 to fill up all space

6) Move sda5 (swap) left or delete it

7) Move/resize sda6 (/home) to fill up the larger amount of space

At this point, you can reboot into your system. Note that none of these operations modified sda7, but it is generally safe to move/resize it.

The only really annoying thing is that gparted does NOT tend to preserve UUID when moving/resizing a swap partition. This is why I suggest commenting out the swap partition entry to minimize the number of things that can go wrong. You can add it again later, using "blkid" to get the new UUID for the swap partition.

My own personal preference is to get rid of swap partitions altogether. I usually eliminate swap partitions and replace them with swap file instead. Much easier to manage, and more flexible. The only down side is that a swap partition is easier to share among multiple linux installs (if you're into distro hopping).
 
Old 10-23-2016, 04:07 AM   #13
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
I followed this in VM:
use dd to make image and transfer it to new root
reinstall and update grub
remove old root
everything is working fine in VM
I think now its time to apply to original system
 
Old 10-24-2016, 12:47 AM   #14
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076

Rep: Reputation: 205Reputation: 205Reputation: 205
unless your willing to re install what you want to do can't be done
BUT
if you leave the end of sda2 right where it is you can cut a larger
sda1 from the space you will get from deleting sda1 and sda2
and recreating those partions IMHO it would be better to use fdisk for this you will have much better control over what you are doing
mount sda2 as /home/ftp/downloads with an owener of nobody and full read write for everybody
 
Old 10-24-2016, 12:59 AM   #15
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 401

Original Poster
Rep: Reputation: Disabled
Problem solved. Thanks everyone
 
  


Reply



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
Fedora 15 - Changing Eth Device Naming Scheme! zer0signal General 10 01-26-2011 06:46 PM
Partition Scheme mschwartz3377 Linux - Hardware 3 04-09-2005 01:36 AM
Changing color scheme for Gnome desktop maelstrom209 Linux - Software 2 12-26-2004 09:30 PM
Changing the color scheme for MOTIF danishmr Linux - Software 0 01-07-2004 01:10 AM
Partition Scheme Stephanie Linux - General 9 08-16-2001 11:19 PM

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

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