Author Topic: Partition Setup  (Read 1005 times)

gavinjb

  • Guest
Partition Setup
« on: April 13, 2010, 11:53:07 AM »
Hi,

I am looking at installing PCLinuxOS when it is available to download (when the new version is released I believe), but I am currently looking at the partition setup and my current thoughts are as follows.

1. Windows (unfortunately I need this for dialing into Work!)
2. Root Partition
3. Data Partition (need to point my Data folders to this e.g. Documents, Pictures etc)

Can anyone help me with the third partition as I am not sure how I setup various Folders in my Home Folder to actually be on the Data Partition.

With this setup I can easily re-install the OS if I need to at any point with out having to restore my data and as I have over 100gb of data it can be time consuming to recover.

Thanks,



Gavin,

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5337
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Partition Setup
« Reply #1 on: April 13, 2010, 12:18:55 PM »
Hi,

I am looking at installing PCLinuxOS when it is available to download (when the new version is released I believe), but I am currently looking at the partition setup and my current thoughts are as follows.

1. Windows (unfortunately I need this for dialing into Work!)
2. Root Partition
3. Data Partition (need to point my Data folders to this e.g. Documents, Pictures etc)

Can anyone help me with the third partition as I am not sure how I setup various Folders in my Home Folder to actually be on the Data Partition.

With this setup I can easily re-install the OS if I need to at any point with out having to restore my data and as I have over 100gb of data it can be time consuming to recover.

Thanks,

Gavin,

One way to do that would to be use a soft link.  For example:

for your Document directory in the home directory to your data partition

ln -s /home/username/Documents /data/

It will create a link in your home directory like

Documents -> /data/Documents/

You will need a folder on the data partition called Documents for this to work.

Now when you place a file in your home/Documents it is actually out in /data/Documents.

I have removed all the folders such as Pictures, Downloads, Documents, Music and have made soft links for them pointing them all to my data partition to their folders located there. You can get really creative using soft links. They work great if you are using NFS shares also. You can also use them on hidden files too!

Linux make allot of use with soft links.
For example the tmp directory in your home directory actually points to tmp -> /tmp/




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11598
  • ----IOFLU----
Re: Partition Setup
« Reply #2 on: April 13, 2010, 12:37:06 PM »
I just mount the data partition on /home/polack/Documents, no links involved.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5337
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Partition Setup
« Reply #3 on: April 13, 2010, 12:41:07 PM »
I just mount the data partition on /home/polack/Documents, no links involved.

Does that also work for other folders that he wants?




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11598
  • ----IOFLU----
Re: Partition Setup
« Reply #4 on: April 13, 2010, 01:10:33 PM »
I just mount the data partition on /home/polack/Documents, no links involved.

Does that also work for other folders that he wants?


He can put any number of directories he wants in Documents. The point was to get the partition mounted with full access from the users home directory. If he wants he could add a hard drive and mount separate partitions on each of the default /home/user/ directories. In total, I have 9 data partitions, from four drives, currently mounted. I mount them where they're most convenient for me, and use a single fstab for all my installed OS, where only the / partition line varies. No matter what OS I boot, everything is always in the same relative place.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline pags

  • Hero Member
  • *****
  • Posts: 2517
  • Keep it clean.
Re: Partition Setup
« Reply #5 on: April 13, 2010, 02:10:24 PM »
I just mount the data partition on /home/polack/Documents, no links involved.

Does that also work for other folders that he wants?


He can put any number of directories he wants in Documents. The point was to get the partition mounted with full access from the users home directory. If he wants he could add a hard drive and mount separate partitions on each of the default /home/user/ directories. In total, I have 9 data partitions, from four drives, currently mounted. I mount them where they're most convenient for me, and use a single fstab for all my installed OS, where only the / partition line varies. No matter what OS I boot, everything is always in the same relative place.

All true...

Each person needs to evaluate their usage, and based on that (and feed-back, and sage advice, etc  ;)), nust determine what will (might?) work best for them.

I prefer to create a public folder in my /home partition (at the same level as system users), and chmod it to 777, and put common files for all users there...in such a scenario, the soft links are very effective to create "paths" from individual user's space to the common area (Shared Documents, etc...whatever works).  Works well for family vacation photos, home videos, music, etc that you may want to share across multiple user's.

$0.02
 ;D

Offline wyzwyk

  • Full Member
  • ***
  • Posts: 93
Re: Partition Setup
« Reply #6 on: April 13, 2010, 02:37:01 PM »
Quote
In total, I have 9 data partitions, from four drives, currently mounted. I mount them where they're most convenient for me, and use a single fstab for all my installed OS, where only the / partition line varies. No matter what OS I boot, everything is always in the same relative place.
     O-P, do you think you could show us your partitioning scheme?  As a newbie I'm very interested in seeing how the more knowledgeable Linux users set up their systems. 

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11598
  • ----IOFLU----
Re: Partition Setup
« Reply #7 on: April 13, 2010, 05:46:48 PM »
Quote
In total, I have 9 data partitions, from four drives, currently mounted. I mount them where they're most convenient for me, and use a single fstab for all my installed OS, where only the / partition line varies. No matter what OS I boot, everything is always in the same relative place.
     O-P, do you think you could show us your partitioning scheme?  As a newbie I'm very interested in seeing how the more knowledgeable Linux users set up their systems. 

I don't have a scheme, except the scheme of having no scheme. (Did I really say that?) ;D

Basically things just grow in an organic manner. I set up a new hard drive to have a small boot partition first, followed by a swap partition, then install an OS on the third partition. These are all primary partitions. The last primary becomes the extended partition, with the first logical partition being a data partition of a size that seems to be adequate for my immediate needs. The rest of the drive stays empty space, to be used as need arises. The size, and mountpoint, of new partitions, gets determined at the time of creation.

When a drive is full, I sort through it, save what I still want to a new partition on another drive, then start over with that drive. Each drive has at least one OS, so can be used as an independent drive. Some have many OS, like when testing new releases, or when creating a bootable backup of another OS, before doing something that may prove damaging to that OS. If one has room, there's no such thing as too many OS. They give you flexibility, and freedom to experiment and learn.

I buy hard drives not so much when needed, but when I see a bargain price too good to pass up, on a drive as large or larger than the largest I already have. I use mostly Seagate now, because they have the best warranty. Haven't had one fail yet. The last two were 750 GB and 1 TB in size, and are in E-SATA/USB external cases, So I can use them with various physical machines, both as my OS of choice, and to transfer data between machines at other locations. I usually have a fresh installed OS, that I can rsync copy to another machine, or hard drive, if needed. I've used that to install to machines without an optical drive, but also to regular machines as well. The OS I'm typing this from was rsync copied from one of the USB drives, using a liveCD to do the copying.

This BIOS doesn't allow for USB booting, but a copy of the /boot directory of each OS on the USB drives, in the boot partition of the internal drive allows me to boot all the OS on them. The BIOS doesn't see the USB drives, but a loaded Linux kernel does.

[root@fatman ~]# fdisk -l

Code: [Select]
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000565cd

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          30      240943+  83  Linux
/dev/hda2              31         257     1823377+  82  Linux swap / Solaris
/dev/hda3             258       12161    95618880   83  Linux
/dev/hda4           12162       24321    97675200    5  Extended
/dev/hda5           12162       24321    97675168+  83  Linux

Disk /dev/hdb: 164.7 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd7523ebd

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1          13      104391   83  Linux
/dev/hdb2              14         257     1959930   82  Linux swap / Solaris
/dev/hdb3             258        1778    12217432+  83  Linux
/dev/hdb4            1779       20023   146552962+   5  Extended
/dev/hdb5            1779        7860    48853633+  83  Linux
/dev/hdb6            7861       14000    49319518+  83  Linux
/dev/hdb7           14001       20023    48379716   83  Linux

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          39      313236   83  Linux
/dev/sda2              40        1047     8096760   82  Linux swap / Solaris
/dev/sda3            1048        7127    48837600   83  Linux
/dev/sda4            7128      108893   817435395    5  Extended
/dev/sda5            7128       20500   107418591   83  Linux
/dev/sda6           20501       33267   102550896   83  Linux
/dev/sda7           33268       37158    31254426   83  Linux
/dev/sda8           37159       41049    31254426   83  Linux
/dev/sda9           41050       44940    31254426   83  Linux
/dev/sda10          44941       48831    31254426   83  Linux
/dev/sda11          48832       61886   104864256   83  Linux
/dev/sda12          61887      101050   314584798+  83  Linux
/dev/sda13         101051      104942    31262458+  83  Linux
/dev/sda14         104943      108893    31736376   83  Linux

Disk /dev/sdc: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2db1883a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1          13      104391   83  Linux
/dev/sdc2              14         761     6008310   82  Linux swap / Solaris
/dev/sdc3             762        4497    30009420   83  Linux
/dev/sdc4            4498       91201   696449880    5  Extended
/dev/sdc5            4498       16947   100004593+  83  Linux
/dev/sdc6           16948       41750   199230066   83  Linux
/dev/sdc7           41751       45520    30282493+  83  Linux
/dev/sdc8           45521       50506    40050013+  83  Linux
/dev/sdc9           50507       65096   117194143+  83  Linux
/dev/sdc10          65097       79686   117194143+  83  Linux
/dev/sdc11          79687       91201    92494206   83  Linux

Note the thing in common on each of these drives is the boot partition, followed by the swap partition. Originally, all the boot partitions were 100 MB. When I needed more space in the one on /dev/hda, I just turned the /dev/hda2 swap partition off, deleted the first two partitions, recreated the boot partition in a larger size, then another swap partition with the remainder of the space. The last thing done was to use resize2fs to expand the existing filesystem of the boot partition to fill the new larger partition it found itself in. None of the files in the boot partition were in any way damaged during this process, and I did it on the fly from this OS installed on /dev/hda3. Everything was done with the command line in a root terminal. The tools used were fdisk, swapoff, mkswap, swapon, and resize2fs.

The fstab that is shared, but with the / partition line set for this OS is below.

[root@fatman ~]#
cat /etc/fstab

Code: [Select]
# Entry for /dev/hda3 :
LABEL=TR5-2             /                       ext3    defaults                1 1
# Entry for /dev/hda1 :
LABEL=boot200           /boot                   ext3    defaults                1 2
LABEL=TR5-Documents     /home/polack/Documents  ext3    defaults                1 2
LABEL=Documents2        /home/polack/Documents2 ext3    defaults                1 2
LABEL=share7            /share7                 ext3    rw,user,auto,exec       0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec       0 0
LABEL=TV-1              /tv                     ext3    rw,user,auto,exec       0 0
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec     0 0
none                    /proc                   proc    defaults                0 0
# Entry for /dev/sda2 :
LABEL=swap200           swap                    swap    defaults                0 0
# Entry for /dev/sda2 :
LABEL=swap1000          swap                    swap    defaults                0 0
# Entry for /dev/sdc2 :
LABEL=swap750           swap                    swap    defaults                0 0
none                    /dev/pts                devpts  mode=0620               0 0
/dev/fd0                /mnt/floppy             auto    rw,user,noauto,exec     0 0
/dev/cdrom              /mnt/cdrom              auto    ro,user,noauto          0 0
/dev/dvd                /mnt/dvd                auto    ro,user,noauto          0 0
none                    /dev/shm                tmpfs   defaults                0 0

At the moment I have the boot partition mounted, due to the copying of the /boot directory from my new MiniMe 2010 installation on /dev/sda14. Normally that line is commented, and the boot partition is not mounted anywhere.

[root@fatman ~]# ls -l /boot |grep minime
drwxrwxr-x 3 root root    1024 Apr 12 22:05 minime2010/

The minime2010 directory is the renamed copy of the /boot directory mentioned above. The menu.lst entry to use the contents of that directory follow.

[root@fatman ~]# cat /boot/grub/menu.lst |grep minime
kernel (hd0,0)/minime2010/vmlinuz BOOT_IMAGE=MiniMe_2010 root=LABEL=minime2010  resume=LABEL=swap1000 vga=791
initrd (hd0,0)/minime2010/initrd.img

kernel (hd1,0)/minime/vmlinuz BOOT_IMAGE=MiniMe_USB root=/dev/hdb7 acpi=on resume=/dev/hdb2 splash=verbose vga=791
initrd (hd1,0)/minime/initrd.img
kernel (hd1,0)/minime/vmlinuz-2.6.22.17.tex2 BOOT_IMAGE=MiniMe-2.6.22.17.tex2_USB root=/dev/hdb7 acpi=on resume=/dev/hdb2 splash=verbose vga=791
initrd (hd1,0)/minime/initrd-2.6.22.17.tex2.img

There are also entries to boot a MiniMe 2008 installation on /dev/hdb, from a copied /boot directory on that drives boot partition, renamed minime, without the release designation. The BOOT_IMAGE entries indicates that drive was once enclosed in a USB housing, when it was new, then later became an internal drive on this computer.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline wyzwyk

  • Full Member
  • ***
  • Posts: 93
Re: Partition Setup
« Reply #8 on: April 13, 2010, 06:26:00 PM »
O-P, thanks a ton for sharing with me.  That is really appreciated.  As a newbie it's going to take me a little while to process all that I'm looking at, but rest assured I will have a number of questions for you.