LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Repartitioning safely (https://www.linuxquestions.org/questions/slackware-14/repartitioning-safely-502246/)

arubin 11-16-2006 11:43 AM

Repartitioning safely
 
This is my partition set up

sdb1 40GB spare Linux ( was slackware 10.2)
sdb2 4GB swap
sdb3 40GB Slackware 11.0
followed by about 5 partitions for storing data/FAT/playing with other distro.

Swap is far too big and I was thinking of changing this to:

sdb1 2GB swap
sdb2 42GB spare Linux ( was slackware 10.2)
sdb3 etc unchanged

My data and /etc are backed up externallly.

Is it safe to do the repartitioning without damaging sdb3?

TIA

Alan

dohpaz 11-16-2006 11:48 AM

I always assume that it isn't and do a full image of the drive I'm
partitioning. I use G4U:

http://www.feyrer.de/g4u/

That way if anything goes wrong I just restore from the image backup.

weibullguy 11-16-2006 12:03 PM

I concur with dohpaz and strongly second his recommendation. Otherwise, sdb3 shouldn't be harmed.

I also think 2GB for swap is still too big. I have 1GB RAM and a 512MB swap. The most swap I've every seen used was 43MB and that was when I was running a computationally intensive simulation. I mean 70,080 MILLION calculations were performed during the simulation. I was still able to check my e-mail and poke around LQ.org, but mostly just let the simulation run. Just something to think about.

arubin 11-16-2006 12:14 PM

I do not have an ftp server or an empty spare hard disc. Would saving a tar of sdb3 be feasible?

swampdog2002 11-16-2006 12:16 PM

I remember from the first edition of "Slackware Linux Essentials" that it made reference to creating a swap partition that was double the amount of RAM in a user's system. With the amount of RAM in some machines today, which are larger than a few of my hard drives :), I don't know how applicable this is anymore. Typically, I have always created a 1 GB swap partition for my machines, just as my own setup rule. Whether or not I actually need this size I have yet to determine, and the space is not wasted in my case as I never get the opportunity to completely use all the space that my hard drive offers.

arubin 11-16-2006 12:43 PM

I have plenty of disc space and if there is any risk attatched to the procedure I would rather keep things as they are than get the extra 3MB

weibullguy 11-16-2006 12:45 PM

Quote:

Originally Posted by arubin
I do not have an ftp server or an empty spare hard disc. Would saving a tar of sdb3 be feasible?

Quote:

Originally Posted by arubin
followed by about 5 partitions for storing data/FAT/playing with other distro.

Could you use one of these or combine a couple together? Once you know there's been no data corruption, you can nuke the image.

arubin 11-16-2006 01:33 PM

Quote:

Could you use one of these or combine a couple together? Once you know there's been no data corruption, you can nuke the image.
I don't get that. I am worried about damaging sdb3 when I am repartitioning sdb1 and sdb2. Is the safe place to back it up sdb6?

J.W. 11-16-2006 06:50 PM

If there is nothing that you want to save in either /dev/sdb1 or /dev/sdb2, you could simply run cfdisk, delete those two partitions, then redefine the resulting free space into two new partitions. Of course, just to play it safe, do a backup of any data in /dev/sdb3 that is important to you. However, as long as your actions only involve sdb1 and sdb2, I would say you are safe, and there is very little chance that the approach I described above would negatively impact sdb3.

On a different note, I'd also suggest that a 2G swap space is way too large. Keep in mind that the only time swap gets used is when your system load exceeds your RAM capacity, and the system is forced to write memory pages to disk. The old "swap=2xRAM" rule dates from the days when having 16Mg or 32Mg of RAM was considered leading edge, and it actually was pretty common to completely exhaust your RAM. These days, where a typical desktop has 512Mg or 1G of RAM (or even more) it becomes increasingly unlikely that you'd ever use up all your RAM, and thus creating a huge swap space basically just wastes disk space. For large scale systems with thousands of users, Yes, having a lot of swap is critical, but for the typical desktop, if you've got 512Mg of RAM or more, then I'd say that having a 256Mg or 512Mg swap space is plenty, and more likely than not will rarely be used at all. Personally, for a desktop environment, I always define a swap of 256Mg as long as the machine has 128Mg or more of RAM -- for machines with only 128, it follows the "twice RAM" rule, but at higher levels, it becomes increasingly unlikely that you'd actually need to use swap, so way waste the disk space.

Overall, partitioning decisions are highly subjective, so if you ask a lot of people what's "best", you'll get a lot of different answers. Good luck with it either way

arubin 11-17-2006 02:21 AM

Thanks.

I have 2MB of RAM and I had just followed the 2x rule when I set up the system.

gnashley 11-17-2006 06:18 AM

As much space as you have I wouldn't think adding 2GB to your unused partiton would be worth the effort.

Anytime you remove or resize a partition, you#ll lose the info in the following partitions -something to think about when you are first setting up. In other words, try to make the first partitions with an acceptable size and leave the end of the hard disk unpartitioned or filled with extra partitions which are not so important. By shuffling data out of them you can resize them and copy stuff back into them.

Unless you are doing a lot of video or sound editing or 'remastering' iso's, you should never need more than 1Gb of swap. If you have as much as 512MB RAM your swap will almost never be touched.

arubin 11-17-2006 06:23 AM

J.W. says
Quote:

If there is nothing that you want to save in either /dev/sdb1 or /dev/sdb2, you could simply run cfdisk, delete those two partitions, then redefine the resulting free space into two new partitions.
gnashley says
Quote:

Anytime you remove or resize a partition, you#ll lose the info in the following partitions
You cannot both be correct. My guess is J.W is right

gnashley 11-17-2006 06:39 AM

If you delete intermediate partitions, your existing partition numbers will change. If you resize them, you may lose disk space because of unmatched cylinder boundaries.

rkrishna 11-17-2006 06:45 AM

try qtparted, but i will allways suggest to keep a backup of the drive, you can always use "dd" command to have a disk copy. as everyone says it is not worth adding 2gb to our slack partition with thismuch risk. also for you a max of 512 mb swap is needed regards rkrishna

arubin 11-17-2006 07:05 AM

Gnashley
If I go into fdisk delete sdb1 and sdb2 and then create them with different sizes but so that (sdb1 old + sdb2 old) = (sdb1 new + sdb2 new) and write the new partition table why will that necessarily make me lose sdb3?


All times are GMT -5. The time now is 05:34 AM.