LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux Partitions (https://www.linuxquestions.org/questions/linux-newbie-8/linux-partitions-600285/)

Kryptos 11-16-2007 10:40 PM

Linux Partitions
 
Hi everyone.

What happens if a linux partition is filled up?
What kind of partitions can we resize after the installation without loss of data? How can we do it?

Thanks in Advance.

2damncommon 11-16-2007 11:18 PM

You may want to look at the Gparted Live-CD.
Although I have considered resizing Linux partitions I have not done so. I avoid resizing if I can. I have resized both FAT32 and NTFS partitions with commercial software.

davcefai 11-17-2007 01:03 AM

Depending on the distro your automatic partitioning may end up making the /home partition very large. This is where you will keep your data and the one most likely to fill up.

Assuming you are reasonably comfortable with manual partitioning I would suggest this:

Have a look at what the installer is recommending.
Tinker with the partition sizes so that the total comes to about 40MB.
Leave the rest of the disc unpartitioned for now.

After installation create another partition and mount it as /data or whatever you like. Give yourself full permissions to it.

Now, use the /home/yourname directory to save stuff you want to backup regularly. Linux will store all the configuration info here.

Use the /data directory to store things like MP3s, Photos etc which don't change and you either don't backup or only need to backup occasionally.

As a guide, this is what has worked very well for me for a long time:

Code:

Disk /dev/sda: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0005fe80

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        2432    19535008+  83  Linux
/dev/sda2            2433      19929  140544652+  5  Extended
/dev/sda5            2433      10213    62500851  83  Linux
/dev/sda6          10214      12645    19535008+  83  Linux
/dev/sda7          12646      19332    53713296  83  Linux
/dev/sda8          19333      19624    2345458+  83  Linux
/dev/sda9          19625      19929    2449881  82  Linux swap / Solaris

the 2 large partitions are sda5 (/home) and sda7 (/var).
On this disc I made /var large instead of creating a /data partition. This disc is "dedicated" to Debian Linux Unstable.

Code:

Disk /dev/sdb: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3e25f4ef

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1        2550    20482843+  7  HPFS/NTFS
/dev/sdb2            2551        8190    45303300    5  Extended
/dev/sdb3            8191      12269    32764567+  83  Linux
/dev/sdb4          12270      19929    61528950  83  Linux
/dev/sdb5  *        2551        2584      273073+  83  Linux
/dev/sdb6            2585        3192    4883728+  83  Linux
/dev/sdb7            3193        3557    2931831  83  Linux
/dev/sdb8            3558        3982    3413781  82  Linux swap / Solaris
/dev/sdb9            3983        4031      393561  83  Linux
/dev/sdb10          4032        8190    33407136  83  Linux

This disc is set up more like I am suggesting to you:
sdb1 is a 20GB Windows 2000 partition (rarely used).
sdb3 is a "/data" partition
sdb4 is another large partition where I keep Virtual Machine files
sdb 5 is where a Debian Testing OS lives. I have this as an emergency use OS in case sda1 won't boot.

Essentially the message is: "There are no RULES, only recommendations". The neat thing is that, as there is no drive letter nonsense, you can mount other partitions in a way that they appear as normal directories and don't get in your way while working.

onebuck 11-17-2007 06:36 AM

Hi,

Quote:

Originally Posted by Kryptos (Post 2961661)
What happens if a linux partition is filled up?

This depends on the partition(s) use. If it is the '/tmp' and you are attempting to install something then you will certainly have problems with the installation if the space is not sufficient. The '/tmp' is also used to store files when you use most cdrom/dvd software, either to copy/burn or even run a application statically.

The '/var' directory is another potential problem area. If your system logs aren't rotated then you could fill space rapidly. If you use the system with one partition for '/' then you could eventually have problems if the system has a lot of activity. This would depend on the amount of space allocated to the '/'. That is why most servers are setup with separate partitions for many of the system directories.

Sure, with the large disk storage available today the problems do not show up for the average user. But it can happen if you don't plan properly.

Quote:

Originally Posted by Kryptos (Post 2961661)
What kind of partitions can we resize after the installation without loss of data? How can we do it?

I would suggest that you look at the 'Linux File System' section of the 'Slackware-Links' formerly 'Slackware LQ Suggestions Links!'. You will find other good online reference for Linux File Systems and of course other Linux links.

As for the actual partition resizing question, this would depend on how you originally setup the system. If you didn't allocate enough space for a particular system use directory then you have several alternatives. You could backup the system first then re-allocate the space to allow the expansion by using qparted (faq) or even Parted Magic to resize.

If you setup the system with a scheme to allow expansion then the re-allocation would be to backup the system first then just delete the partition(s) using fdisk or cfdisk. You would then create the new partitions with the same fdisk or cfdisk. Of course you would have to make the file systems again with this method. The restore to the partitions would be straight forward with the new space.

Another way would to just add another hard disk to the system, that is if you have the channels available. If you do it this way then you would scheme the partitions to your needs then either symlink or mount the partitions to the directory structure. You would restore the data to the new partition(s) directory tree.


All times are GMT -5. The time now is 02:30 PM.