Author Topic: How to increase partition size [Solved]  (Read 2291 times)

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10628
  • MLUs Forever!
Re: How to increase partition size
« Reply #15 on: July 23, 2012, 10:33:57 AM »
Just18,

I have a screen shot of PCC disk manager, but I do not know how to show it here.  Apparently it has to be a url on the internet.

Jan


Make the window of the "Manage Disk partitions" as wide as possible so that you can see all partitions ....  displayed as segments on the line.

Just confirm that the partitions as listed by fdisk are showing there .....  apparently I misinterpreted your previous post, when you mentioned 'named partitions' ...... 

BTW, to post a pic, you take a snapshot and upload it to a hosting servece like TinyPic.com or others (there are many) and then post the link provided by the service in your post.
There is also a PCLOS specific hosting service provided by one of our users ......  details on the forum.
« Last Edit: July 23, 2012, 10:36:33 AM by Just18 »
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: How to increase partition size
« Reply #16 on: July 23, 2012, 10:41:25 AM »
Bald Brick,

The naming mistake was mine, and I regret it.  I did not realize that the names were mount points, and that the only partition labels are sdaxx, etc. 

I would have done all of this from a PCLinuxOS LiveCD, rather than the minimal Gparted LiveCD, but I have a very poor internet connection, and I was unable to get a good download of PCLinuxOS.

I will look over Old Polack's post tonight and see what I can do.

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10628
  • MLUs Forever!
Re: How to increase partition size
« Reply #17 on: July 23, 2012, 10:46:23 AM »
Bald Brick,

The naming mistake was mine, and I regret it.  I did not realize that the names were mount points, and that the only partition labels are sdaxx, etc.  

I would have done all of this from a PCLinuxOS LiveCD, rather than the minimal Gparted LiveCD, but I have a very poor internet connection, and I was unable to get a good download of PCLinuxOS.

I will look over Old Polack's post tonight and see what I can do.

Jan


It was my misinterpretation that contributed to the confusion ......  but it is best to be careful in such circumstances.

I would think that this procedure could be carried out from the root account of the installed OS ......  but would like confirmation of that from others.
No the partition cannot be unmounted while running as root.
« Last Edit: July 23, 2012, 10:56:05 AM by Just18 »
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6377
  • I'm going South
Re: How to increase partition size
« Reply #18 on: July 23, 2012, 10:56:11 AM »
Quote
Sorry to butt in but it's very obvious that PCC shows mountpoints for just three of his partitions: /, /home and /data. That isn't "three named partitions", but we aren't nitpickers, are we?

What in PCC shows only mounted partitions?

PCC shows all partitions, but it only shows their mountpoints if it finds them in /etc/fstab. It doesn't even show the mountpoints of all mounted partitions. But if it does find an entry for a partition in /etc/fstab it will report the mountpoint even if the partition is not mounted.

So I just found it apparent that the "three named partitions" were the three partitions Ditzian mentioned, as they are the ones that would have had mountpoints defined in fstab. I may have been wrong. But I don't think so.

Quote
.....  and yes, if giving instructions which could wipe or overwrite a part of the OS 'nit-picking' is required  :D

I don't want to hear cries of ....  "you ruined my install" because I made an assumption that was not correct  ;)

A noble sentiment, no doubt. And believe it or not, neither would I. But some things are just so obvious.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10628
  • MLUs Forever!
Re: How to increase partition size
« Reply #19 on: July 23, 2012, 10:57:07 AM »
Quote
But some things are just so obvious.

Only when you see them  :D  ;D

MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: How to increase partition size
« Reply #20 on: July 23, 2012, 05:35:16 PM »
Just18,

I regret to say this, but there are so many dissimilarities between what Old-Polack addressed in that post and my situation, that I cannot be sure I am doing what he suggests.  I would like to first get a broad outline of the steps.  I offer the following, mostly because I do not understand why Old-Polack is doing what he is doing, and because his client had already done some things that I have not done.

The desired partition for /home is sda10.  /home is now on sda6

Login: jan
PCC: Set mount point for sda10 to me /mnt/home  #Set a temporary mount point for the future /home.
PCC: Mount /mnt/home  #Mount the temporary mount point for the future /home
Konsole: rsync -av /home/ /mnt/home  #Copy the contents of /home/ to /mnt/home
PCC: umount /home
PCC: umount /mnt/home
PCC:  Set new mount point for /home to be /mnt/temp
PCC:  Set new mount point for /mnt/home to be /home
reboot and login:jan
if all is well empty /mnt/home, rename if desired

Clearly, I have not addressed fstab, and that must be done.  I must also have violated a number of permitted operations, and I would like guidance about which ones and what I should be doing.  I believe that some of the trips to root recommended by Old-Polack are intended to get fstab to update itself.  If necessary, I could add a line to fstab, since Gparted can tell me the UUID of each formatted partition.

Thank you,

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10628
  • MLUs Forever!
Re: How to increase partition size
« Reply #21 on: July 23, 2012, 06:52:09 PM »
I am on my way out, so unfortunately I cannot address this immediately ....  and will need to get some sleep after that .....  so if you can wait for 10 hours or so I will come back to this ......  or if O-P comes across it he might jump in.

Sorry about the delay .....  I don't wish to rush a post at this time.

Be back later  ;)


MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: How to increase partition size
« Reply #22 on: July 23, 2012, 07:09:11 PM »
No problem.  I have no intention of taking any steps until I understand better what I am doing.  the system works now, and I will take care to put as little as possible in /home.

Jan

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6377
  • I'm going South
Re: How to increase partition size
« Reply #23 on: July 23, 2012, 08:20:36 PM »
As Just18 is on his way out I'll butt in once more.

Just18,

I regret to say this, but there are so many dissimilarities between what Old-Polack addressed in that post and my situation, that I cannot be sure I am doing what he suggests.  I would like to first get a broad outline of the steps.  I offer the following, mostly because I do not understand why Old-Polack is doing what he is doing, and because his client had already done some things that I have not done.

The desired partition for /home is sda10.  /home is now on sda6

Login: jan
PCC: Set mount point for sda10 to me /mnt/home  #Set a temporary mount point for the future /home.
PCC: Mount /mnt/home  #Mount the temporary mount point for the future /home
Konsole: rsync -av /home/ /mnt/home  #Copy the contents of /home/ to /mnt/home
PCC: umount /home
PCC: umount /mnt/home
PCC:  Set new mount point for /home to be /mnt/temp
PCC:  Set new mount point for /mnt/home to be /home
reboot and login:jan
if all is well empty /mnt/home, rename if desired

Clearly, I have not addressed fstab, and that must be done.  I must also have violated a number of permitted operations, and I would like guidance about which ones and what I should be doing.  I believe that some of the trips to root recommended by Old-Polack are intended to get fstab to update itself.  If necessary, I could add a line to fstab, since Gparted can tell me the UUID of each formatted partition.

Thank you,

Jan


On the whole you've got it, but you make the operation sound more complicated than it is. Actually you just want to:

1) Copy everything from /dev/sda6 (your old /home) to /dev/sda10 -- including links, ownerships and permissions;
2) Edit /etc/fstab so that /dev/sda10 is mounted on /home the next time you boot, and /dev/sda6 isn't;
3) Reboot to check that everything works with your new /home;
4) If it does, erase everything on /dev/sda6 so that you can use the partition for other things.



1)

a. Before you can start copying you have to mount /dev/sda10 somewhere. You could let the system do the mounting, or you can manually create a temporary mountpoint (i.e. an empty directory) and mount it there, but you have to know where it is mounted, so doing it manually is probably safer. /mnt/home would be as good a temporary mountpoint as any. If you create the mountpoint under /mnt you should do so as root. /mnt is owned by root. You can create it with
Code: [Select]
mkdir -p /mnt/home and you can mount it with
Code: [Select]
mount /dev/sda10 /mnt/home
b. You've reported that /dev/sda10 is empty and formatted as ext4, but check that this is true before you start copying to it.

c. If you've decided to use rsync for the copying and if /dev/sda10 is mounted on /mnt/home, you only need to enter the line
Code: [Select]
rsync -av /home/ /mnt/home to do the copying. You need the -a option to retain ownerships, permissions, links and time stamps. You don't really need the -v option, but you'll get more feedback during the operation if it's there. And don't forget the trailing slash at the end of /home/. If you use /mnt/home as your temporary mountpoint you should do this too as root.

Note that in O-P's example (that Just18 linked to) he didn't copy all of /home but only /home/<username>.


2)

When editing /etc/fstab you just have to change the UUID number in the line
Code: [Select]
UUID=<long-hexadecimal-number> /home ext4 defaults 1 2to the correct one for /dev/sda10. You have to do this too as root.

To keep everything tidy you could edit the comment line above it too:
Code: [Select]
# Entry for /dev/sda6 : should be
Code: [Select]
# Entry for /dev/sda10 :
But that line is actually ignored by the system.


3)

Don't erase anything on /dev/sda6 before you are certain that your system works with your new /home.


4)

To be able to empty /dev/sda6 you have to mount that partition too -- or else you could simply reformat it.


(Diskdrake in PCC can actually do most of the above semi-automatically, but I'd do it manually to know what really happens.)
« Last Edit: July 24, 2012, 04:18:48 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: How to increase partition size
« Reply #24 on: July 23, 2012, 08:31:48 PM »
Bald Brick,

It sounds like I understand you and agree with you.  But for now..........

Tomorrow, tomorrow, I love you, tomorrow
You're always a day away

Thank you,

Jan

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10628
  • MLUs Forever!
Re: How to increase partition size
« Reply #25 on: July 24, 2012, 02:55:32 AM »
Just logged on having slept a little ;)

BB, thanks for stepping into the breach  ;)

I have only one 'worry' about the method you outlined ...  as /home is mounted in the running OS during the copying, I would be fearful that copying it might cause some problems ...  some files changing during the copying period.
I would be 'more at ease' if the operation could be carried out when booted from a liveCD.

****************************************************

There is probably no real reason for my 'worry', but if doing it from a liveCD this is what I would do ...

Boot from a liveCD.
Open a terminal and issue the command

su

enter the password when requested ...  it is  root   for the liveCDs of PCLOS.

Keep this terminal open until you are ready to reboot having finished the job.

Enter the following commands

umount -a                                    ## unmounts all partitions in case some were mounted automatically on boot

mkdir  -p   /mnt/oldhome                  ##  create a mount point for the old home partition
mkdir  -p  /mnt/newhome                 ##  create a mount point for the new home partition

EDIT:  -p   option added to above commands to ensure the location /mnt  is created if it doesn't exist.

mount  /dev/sda6    /mnt/oldhome             ##  mount the oldhome partition
mount  /dev/sda10  /mnt/newhome           ##  mount the newhome partition

## Before proceding with the copying, check there are no files in /mnt/newhome. You can use a filemanager to do this if you wish, or use the command
ls  -a   /mnt/newhome
## from the terminal. Ignore the presence of "lost & found" which is a filesystem directory and should be present.
## When satisfied that there is nothing you need on /mnt/newhome proceed with the copying ...

rsync   -av   /mnt/oldhome/     /mnt/newhome   ## copy the contents of the oldhome partition to the newhome partition

***

When copying is finished you should compare the contents of the two partitions ....  visually in a filemanager and through properties of  /mnt/newhome  with   /mnt/oldhome.
They should have the same number of files and directories (and use approximately the same space).

If all seems ok, then proceed with editing fstab. You need to mount the / partition of the HDD OS and edit its fstab file. So

mkdir  /mnt/oldroot
mount  /dev/sda5  /mnt/oldroot      ## where /dev/sda5 is the root partition of the installed OS. Change this if different.

kwrite                 ## if using KDE, else launch whatever is the preferred text editor

Use it to open the file  /mnt/oldroot/etc/fstab  file.

Identify the lines referring to the mount point of 'oldhome' and place a '#' at the beginning of the line which causes the OS to ignore it. Insert the new line to use the 'newhome' partition as /home.

As an example my fstab has this entry

Code: [Select]
# Entry for /dev/sda6 :
UUID=d84f747a-2134-419c-bb38-3567a5af14de /home ext4 defaults,user_xattr 1 2

add a '#' to make it look like this

Code: [Select]
# Entry for /dev/sda6 :
#UUID=d84f747a-2134-419c-bb38-3567a5af14de /home ext4 defaults,user_xattr 1 2

issue the following command to get the UUI number of the 'newhome' partition

blkid -c  /dev/null /dev/sda10

You should see something like the following

Code: [Select]
blkid -c  /dev/null /dev/sda10
/dev/sda10: LABEL="Home" UUID="54291c98-bc73-4c36-af47-12843b2a56b1" TYPE="ext4"
{yours won't have a 'Label' unless you applied one so ignore that, and your UUID number will be different}

Now create a new fstab entry for the 'newhome' by copying the old one and changing the UUID number and the partition device number ...... which should look something like this

Code: [Select]
# Entry for /dev/sda10 :
#UUID=<insert number from *your* blkid command>   /home   ext4   defaults,user_xattr 1 2

***Note:  do not copy my example, but copy the existing entry and make the necessary changes to that**

Save the file.

Still using the same terminal session, issue the command

umount  -a

which will unmount the partitions you used during the work.

Reboot into the installed OS and check that all is well.

Give it a couple of days before you wipe or reformat the oldhome partition for other uses.

BTW .....  do NOT delete the oldhome partition, just reformat it for other use.

***

The above scheme is a little longer than that proposed by BB, because you are working from a separate OS and so the locations you want to access have to be specifically mounted etc.

Even so, to my mind (and being conservative about this type of operation) this would be my preferred way.

Either way ......  provided you do not damage the 'oldhome' contents in any way, you will have the option of redoing this if something does not work as expected.

***

I hope my adding this post has not confused things further  :(

Regardless which scheme you intend to use, please post back before proceeding, if in doubt about any of it.

;)
« Last Edit: July 24, 2012, 06:55:02 AM by Just18 »
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6377
  • I'm going South
Re: How to increase partition size
« Reply #26 on: July 24, 2012, 04:14:31 AM »
I have only one 'worry' about the method you outlined ...  as /home is mounted in the running OS during the copying, I would be fearful that copying it might cause some problems ...  some files changing during the copying period.
I would be 'more at ease' if the operation could be carried out when booted from a liveCD.

You are right of course. Better to err on the side of caution.  ;)
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10628
  • MLUs Forever!
Re: How to increase partition size
« Reply #27 on: July 24, 2012, 04:21:19 AM »
I have only one 'worry' about the method you outlined ...  as /home is mounted in the running OS during the copying, I would be fearful that copying it might cause some problems ...  some files changing during the copying period.
I would be 'more at ease' if the operation could be carried out when booted from a liveCD.

You are right of course. Better to err on the side of caution.  ;)


Could you please have a read-through of the method I posted to ensure errors are corrected before the method is used?

I wrote it 'on the fly' this am, so anything is possible  ;)

Thanks.
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6377
  • I'm going South
Re: How to increase partition size
« Reply #28 on: July 24, 2012, 06:26:55 AM »
I have only one 'worry' about the method you outlined ...  as /home is mounted in the running OS during the copying, I would be fearful that copying it might cause some problems ...  some files changing during the copying period.
I would be 'more at ease' if the operation could be carried out when booted from a liveCD.

You are right of course. Better to err on the side of caution.  ;)


Could you please have a read-through of the method I posted to ensure errors are corrected before the method is used?

I wrote it 'on the fly' this am, so anything is possible  ;)

Thanks.

Most of your procedure should certainly work, but to be on the safe side I booted a live CD and ran through some of it, and I found that one of your commands may have to be slightly modified:

mkdir   /mnt/oldhome  should be  mkdir  -p  /mnt/oldhome,

The problem is that on at least one new live CD there is no /mnt directory by default, so you have to use the -p option to create not only the subdirectory oldhome but also its parent directory /mnt. After that you naturally don't have to use the -p option when you create  /mnt/newhome: by then /mnt already exists.

The default /mnt folder was missing on my Test5 live CD. I don't know if the same is true about other newer live CDs, but in any case routinely adding "-p" to the command won't hurt.

Apart from that I don't see anything wrong with your method.


 

« Last Edit: July 24, 2012, 06:30:11 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: How to increase partition size
« Reply #29 on: July 24, 2012, 06:42:33 AM »
I do not have time right now to digest all of this and to take action.  However, I did manage to download and burn a Mini KDE iso of PCLinuxOS, which is also untested as yet, but which may serve as the LiveCD to follow Just18's suggestion. 

By the way, that was why I had such a limited approach to the initial use of Gparted--I was running from a LiveCD of only Gparted and the minimal Debian that was on the Gparted disk.  I had no access to the good Gparted interface available in PCLinuxOS, or the other support from a good, complete distro.

Jan