LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Is it safe to resize my Slackware partitions after removing my Mint 10 partitions? (https://www.linuxquestions.org/questions/slackware-14/is-it-safe-to-resize-my-slackware-partitions-after-removing-my-mint-10-partitions-863368/)

Robert.Thompson 02-17-2011 01:36 PM

Is it safe to resize my Slackware partitions after removing my Mint 10 partitions?
 
Hello:

I've reached a point in my Slackware journey where I feel confident enough to remove my Mint 10 linux. It used to be my 'go to distro' when I trashed my Slackware installation. Now, I have Slax on a USB and I think that is enough.

Mint 10 occupies /dev/sda5 (root) and /dev/sda6 (home) while Slackware occupies /dev/sda7 (root) and /dev/sda8 (home).

If I delete the /dev/sda5 & /dev/sda6 partitions, can I very safely resize /dev/sda7 and /dev/sda8 to use the space freed up?

Thanks,

repo 02-17-2011 01:40 PM

Quote:

can I very safely resize /dev/sda7 and /dev/sda8 to use the space freed up?
Always backup your data before resizing.

Kind regards

hitest 02-17-2011 01:43 PM

I've had quite good luck using parted to re-size ext partitions, your mileage may vary. Back up your PC *before* you attempt deleting, re-sizing in the event that things go awry. Good luck.

http://www.gnu.org/software/parted/

http://gparted.sourceforge.net/livecd.php

T3slider 02-17-2011 01:55 PM

I may be wrong but I believe you can only resize into adjacent partitions, so that may give you issues. LVMs make resizing a much more pleasurable experience but they obviously add another level of complexity to deal with.

Darth Vader 02-17-2011 02:39 PM

It's someone who noticed that our OP want to MOVE DOWN AND RESIZE these partitions? :D

Robert.Thompson 02-17-2011 02:50 PM

Hello:

I am waiting for my 'dd' back ups of /dev/sda7 & /dev/sda8 to complete.

Is the fact that sda5 & sda6 are before my Slackware partitions a problem?

Would it be better to, after my backups complete, delete all 4 of my linux partitions and then create 2 new ones and then restore from my back up, or, is this even possible from a 'dd' back up living on my external hard drive?

Thanks,

Darth Vader 02-17-2011 03:02 PM

Well, that method can work if you use EXT2/3/4FS. If you use the condition that these new partitions are somewhat bigger than the original.

Create the new partitioning, DD it back and use resize2fs for resizing the filesystems in the right sizes.

Then, mount the target root partition and reconfigure it for the new partition layout. Enjoy! :)

w1k0 02-17-2011 03:22 PM

I always backup the system partition (you call it root) as tar.gz file using the command such as:

tar czf /path/to/the/backup/directory/name_of_the_backup_file.tgz *

As for the data partition (you call it home) I always backup it as is on the external drive using the command such as:

rsync -av /source/directory /destination/directory

In the past I did backup of Windows XP system using dd command. The result wasn't satisfactory. When I tried to restore the system with dd command on the partition smaller than the original one Windows XP refused to work. On the other hand when I tried to restore it on the bigger partition then the original one I wasted some space because I wasn't able to resize that partition.

Linux can cause other problems. Assuming the system you backed up was on /dev/sda7 partition and the bootloader was installed on the same partition and you try to restore it on /dev/sda5 partition the result will be a mess.

So I suggest to use tar to backup system partition and rsync to backup data partition.

Robert.Thompson 02-17-2011 03:23 PM

Quote:

Originally Posted by Darth Vader (Post 4261969)
Well, that method can work if you use EXT2/3/4FS. If you use the condition that these new partitions are somewhat bigger than the original.

Create the new partitioning, DD it back and use resize2fs for resizing the filesystems in the right sizes.

Then, mount the target root partition and reconfigure it for the new partition layout. Enjoy! :)

Sorry Darth, but I have some questions.

My Slackware partitions are ext4 and so is my back up partition on my external USB drive.

Actually, I am so confused right now that I can't formulate the questions!

I've got to think about all of this.

Thanks for the food for thought.:)

T3slider 02-17-2011 04:00 PM

If you create a successful `dd` backup you can delete the other partitions and create two new ones of satisfactory size (though they must be at least as big as they are now) and restore the filesystem onto the new partitions. However, when you first boot, the filesystem has not been resized so although it is living in a bigger partition you will not have access to more space. Luckily ext4 filesystems can be resized using resize2fs as stated, so you can then resize the filesystem to take up the rest of the room in each partition and then you're golden. However since the partition names may be different you may have to modify /etc/fstab and /etc/lilo.conf (don't forget to run lilo) to accommodate the new device names.

If you do make a mistake or can't figure it out, you should be able to reinstall Slackware on the resized partitions and get at any data stored in the dd backups by mounting the images and pulling any files you need.

Darth Vader 02-17-2011 04:10 PM

Quote:

Originally Posted by Robert.Thompson (Post 4261996)
My Slackware partitions are ext4 and so is my back up partition on my external USB drive.

Wait a second! You do an partition to partition backup? That's very bad thing. You should do the dump to an backup file.

Robert.Thompson 02-17-2011 04:24 PM

Quote:

Originally Posted by Darth Vader (Post 4262049)
Wait a second! You do an partition to partition backup? That's very bad thing. You should do the dump to an backup file.

Hello Darth:

I don't understand.:confused:

I have an external USB hard disk on which there are 2 partitions: 1 ntfs & 1 ext4.

I did my back ups like this where /dev/sdb2 is mounted at /tmp/USBdrv:
Code:

# dd if=/dev/sda8 of=/tmp/USBdrv/slackhome.img bs=64k
# dd if=/dev/sda7 of=/tmp/USBdrv/slackroot.img bs=64k

What should I have done?

Thanks,

Darth Vader 02-17-2011 04:33 PM

Quote:

Originally Posted by Robert.Thompson (Post 4262065)
I have an external USB hard disk on which there are 2 partitions: 1 ntfs & 1 ext4.

I did my back ups like this where /dev/sdb2 is mounted at /tmp/USBdrv:
Code:

# dd if=/dev/sda8 of=/tmp/USBdrv/slackhome.img bs=64k
# dd if=/dev/sda7 of=/tmp/USBdrv/slackroot.img bs=64k


That's the right thing. I was worried that you do an DD from /dev/sdeX to /dev/sdeX... :)

tacticalbread 02-17-2011 04:36 PM

if /tmp/USBdrv/ is where your external is mounted, then that's just fine. ;)

I had Ubuntu on /dev/sda1, Windows on /dev/sda2, and slackware on /dev/sda3, and I deleted my Ubuntu partition, and moved the other two over, and I've had no problems. (Although I have no /dev/sda1 :P)

Robert.Thompson 02-17-2011 04:49 PM

Quote:

Originally Posted by T3slider (Post 4262034)
... Luckily ext4 filesystems can be resized using resize2fs as stated, so you can then resize the filesystem to take up the rest of the room in each partition and then you're golden. However since the partition names may be different you may have to modify /etc/fstab and /etc/lilo.conf (don't forget to run lilo) to accommodate the new device names...

Thank you.

Do I need to down load and install resize2fs before doing any of this? If so, I will have to do new back ups, right?

Also, am I to use the installed 'KDE Partition Manager' to do all this?

Thanks,


All times are GMT -5. The time now is 05:11 PM.