Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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.
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.
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.
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.
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).
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.