You are not logged in.

#1 2013-09-14 12:31:18

toni
Member
Registered: 2011-10-15
Posts: 437

[SOLVED]Create Partitions to get best hdd performance reading/writting

I am going to install arch in a new hard drive (320GB) and a laptop with 8GB RAM so I have decided to do the below partitions and sizes:

- \ root 160GB
- \tmp 8GB
- \var 30GB
- \boot 10GB
- \home 100GB
- \swap 10GB

I would like to place the partition most used in the sectors of the hdd disc that are supposed to be accessed more faster. As far as I know the fatest zone of an hdd is the outer one and the slowest the inner one. I would like to know:

1.- Where is the first sector or byte? in the outermost or innermost zone? I mean what zone is considered the beginning of the disc and what the end?
2. I want to organize the partition that is used more in the fast zone of the hdd and the less used in the slowest one so I have thought in the below distribution:

Outer zone (Fastest)                                                                             Inner zone (Slowest)
-------------------------------------------------------------------------------------------------------------------------
|      \boot      |        \var      |          \root       |        \home      |        \tmp      | \swap |
-------------------------------------------------------------------------------------------------------------------------
First Block hdd                                                                                     Last block of hdd

Or according to my partitions what distribution on the disc do you think is better (take into account I want most used partitions in the outer zone - fastest)?

3.- Do you think its necessary to create a separate partition for \opt?

4.- I want to install arch in an external hdd drive (this new drive will be usb3.0 external within a enclosure) so I want the syslinux bootloader to install in it and not in the hdd main of my laptop, is it possible during arch installation process to tell arch to put boot loader in the external hdd? Do I have to do something special to get rid of this?
By doing this I want to achieve the following behaviour in my laptop when it starts up (the same I had in my old died hdd):
If I plug the external hdd when my computer starts up, bios shows me the devices to boot from, so I choose external hdd drive where arch will be installed and syslinux is loaded and then arch linux starts booting. If I do not plug in the external hdd then my computer boots in normal way, booting from main laptop hdd (starting loading W*n*o*s).
(Maybe in this case syslinux is not necessary to show the menu at startup and directly booting arch as in this external hdd only lives arch, no other OS).

Last edited by toni (2013-09-16 22:27:10)

Offline

#2 2013-09-14 13:19:40

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

Some remarks:

  • I doubt that you will notice much difference due to the location of the partitions on the disk.

  • I strongly recommend creating a boot partition and a single LVM partition. This will provide much more flexibility later. In particular, you should reduce the sizes of most of those partitions and keep the extra space for swapping file systems (i.e. by creating a new partition with a new FS, copying over the files from the old partition, and then removing the old partition)

  • Unless you are going to install over 200 different kernels then there is no reason to have a 10 GB boot partition. I do not even use half of my 100 MB boot partition with syslinux.

  • 30 GB for /var is also huge, unless you're going to install loads of games with huge data packages

  • 160 GB for root is also huge. I have over 1300 packages installed (including some huge games, GHC and related packages, texlive and office suites)) on less than 20 GB.

  • with 8 GB of ram, you could skip a /tmp partition and put /tmp in tmpfs

As for your desired behavior with the external disk, configure your bios (assuming you have bios) to boot the external disk before the internal one. On the external disk, configure the syslinux menu to include a chainloader for the internal disk and make sure that it is configured to show the menu. When the disk is present during boot you will see the menu, otherwise it will boot straight to windows.

Note, however, that this is a security risk. Anyone can connect a bootable disk to your usb port, turn on the computer, and boot their own OS, which will give them access to any unencrypted data that you have on the internal disk. I would recommend using a bios password if you want this setup.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2013-09-14 13:51:22

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

Xyne wrote:

Some remarks:

  • I doubt that you will notice much difference due to the location of the partitions on the disk.

  • I strongly recommend creating a boot partition and a single LVM partition. This will provide much more flexibility later. In particular, you should reduce the sizes of most of those partitions and keep the extra space for swapping file systems (i.e. by creating a new partition with a new FS, copying over the files from the old partition, and then removing the old partition)

  • Unless you are going to install over 200 different kernels then there is no reason to have a 10 GB boot partition. I do not even use half of my 100 MB boot partition with syslinux.

  • 30 GB for /var is also huge, unless you're going to install loads of games with huge data packages

  • 160 GB for root is also huge. I have over 1300 packages installed (including some huge games, GHC and related packages, texlive and office suites)) on less than 20 GB.

  • with 8 GB of ram, you could skip a /tmp partition and put /tmp in tmpfs

As for your desired behavior with the external disk, configure your bios (assuming you have bios) to boot the external disk before the internal one. On the external disk, configure the syslinux menu to include a chainloader for the internal disk and make sure that it is configured to show the menu. When the disk is present during boot you will see the menu, otherwise it will boot straight to windows.

Note, however, that this is a security risk. Anyone can connect a bootable disk to your usb port, turn on the computer, and boot their own OS, which will give them access to any unencrypted data that you have on the internal disk. I would recommend using a bios password if you want this setup.

so then following your instructions, you refer to create 2 partitions:
1) \boot partition 100-200MB for example
2) the rest of the disk dedicate entirely to a single LVM partition

Now, can I create a LVM partition from gparted?
once I create boot and LVM paritions, I install arch but once that is done, how can I manage my LVM partition, for instance if later I want to create a new partition within LVM or resize partitions previously created within LVM?

Offline

#4 2013-09-14 13:58:20

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

toni wrote:

so then following your instructions, you refer to create 2 partitions:
1) \boot partition 100-200MB for example
2) the rest of the disk dedicate entirely to a single LVM partition

Yes, that's what I would do, with a 100 MB boot partition.

toni wrote:

Now, can I create a LVM partition from gparted?

I have never used gparted, but I expect that it is possible to create LVM partitions with it. If not,  you can use cfdisk. If you are trying to save data that is already on the disk then you will need to move it to another disk first.

toni wrote:

once I create boot and LVM paritions, I install arch but once that is done, how can I manage my LVM partition, for instance if later I want to create a new partition within LVM or resize partitions previously created within LVM?

That should all be covered on the LVM wiki page.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2013-09-14 15:35:08

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

I would also recommend using LVM.

I would consider using a GPT partition table on the external disk rather than MBR. gparted can do this but you'd use gdisk rather than fdisk, for example. (fdisk can now deal with GPT but it is early days - gdisk is a better choice.)

Personally, I would use a larger partition for boot than 100MB unless you are really pushed for space. Should you ever decide you want to use grub, for example, you might want more space. You might even want to include .iso files since grub can boot these directly. You don't need anything like 10G. I currently have 1G for /boot (and another 1G for the EFI partition) but I think 500MB would be more than enough for BIOS booting. Of course, if you are sure you never want to do any of this, you don't need the space but I think it is a useful option to have. I currently use 464M of my boot partition and 380M of my EFI partition. This includes grub, rEFInd, isos, multiple kernels and initramfs etc.

EDIT: And don't make /tmp a partition. As was pointed out above, better to have this in tmpfs. You don't need to worry about /tmp at all, in fact. systemd will take care of setting it up automatically. Just ignore it and it will take care of itself. (You don't even need a line in fstab any longer.)

Last edited by cfr (2013-09-14 15:37:40)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-09-14 16:18:37

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

cfr wrote:

I would also recommend using LVM.

I would consider using a GPT partition table on the external disk rather than MBR. gparted can do this but you'd use gdisk rather than fdisk, for example. (fdisk can now deal with GPT but it is early days - gdisk is a better choice.)

Personally, I would use a larger partition for boot than 100MB unless you are really pushed for space. Should you ever decide you want to use grub, for example, you might want more space. You might even want to include .iso files since grub can boot these directly. You don't need anything like 10G. I currently have 1G for /boot (and another 1G for the EFI partition) but I think 500MB would be more than enough for BIOS booting. Of course, if you are sure you never want to do any of this, you don't need the space but I think it is a useful option to have. I currently use 464M of my boot partition and 380M of my EFI partition. This includes grub, rEFInd, isos, multiple kernels and initramfs etc.

EDIT: And don't make /tmp a partition. As was pointed out above, better to have this in tmpfs. You don't need to worry about /tmp at all, in fact. systemd will take care of setting it up automatically. Just ignore it and it will take care of itself. (You don't even need a line in fstab any longer.)

Thanks for the suggestion. What type of file system do you recoomend for EFI System partition? Also which is better GRUB, GRUB2 or Syslinux? What do you recommend and why? Until now I was using Syslinux.

Also if in a future for any reason I have to delete GPT partition table on this external hdd, is it easy to do with some tool? for example with gparted? or some other tool bootable from a usb media for example?

Thanks.

Last edited by toni (2013-09-14 16:36:30)

Offline

#7 2013-09-14 16:59:59

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

You only need an EFI partition if you plan to boot in EFI mode. I assumed you were not planning to do that. If you are, you need a partition of at least 512MB formatted Fat 32.

Legacy grub is no longer supported although grub-legacy is available from AUR. On Arch, "grub" is grub2. It isn't better than syslinux - lots of people would say it is worse as it is more complicated. It is just that if you might want to use it - and there are things grub can do which syslinux cannot - I think it makes sense to leave that possibility open.

You can delete a GPT partition table as easily as a MBR partition table, yes. From the Arch live media if you want or using gparted or whatever.

PS If you go GPT and boot in BIOS mode, you might want to create a bios boot partition in case you ever do wish to use grub. This only needs to be 1-2M.

Last edited by cfr (2013-09-14 17:01:02)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-09-14 17:04:03

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

cfr wrote:

You only need an EFI partition if you plan to boot in EFI mode. I assumed you were not planning to do that. If you are, you need a partition of at least 512MB formatted Fat 32.

Not true... mine is only 100 MB and boots fine.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2013-09-14 17:36:09

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

graysky wrote:
cfr wrote:

You only need an EFI partition if you plan to boot in EFI mode. I assumed you were not planning to do that. If you are, you need a partition of at least 512MB formatted Fat 32.

Not true... mine is only 100 MB and boots fine.

512 MB is safe. A smaller partition works on a lot of hardware but some EFI firmware is fussier. A smaller partition may work in those cases with Fat 16 but that's not part of the spec and so may not work either. To be sure, you need 512 MB and Fat 32. For example, my firmware is OK with a smaller partition only if it uses Fat 16 but since that's not spec, it isn't really a safe recommendation. My firmware also works fine with a larger partition and Fat 32. Anything else, though, and the firmware claims no OS is installed at all.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2013-09-14 18:03:35

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

Sorry by my ignorance, but is it possible to have 2 boot partitions? I mean, \boot and that EFI partition you say. What can I do with an EFI partition?

I have decide to use GPT. I am going to do the following:

1) Create \boot partition
2) Create LVM partition
3) Use GPT partition table

I do not understand what you said:

PS If you go GPT and boot in BIOS mode, you might want to create a bios boot partition in case you ever do wish to use grub. This only needs to be 1-2M.

Do I have to create another partition if I use GPT? As I have read  bios partition is used by standard BIOS-based machines in order to boot when the partition table of the device is a GPT label. So If I do not create a bios partition, arch in external hdd will not boot right? How can I create a bios partition? I have to create this during arch installation, before arch installation, or after arch installation?

Many thanks for your help and time spent.

Offline

#11 2013-09-14 18:08:22

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

toni wrote:

Sorry by my ignorance, but is it possible to have 2 boot partitions? I mean, \boot and that EFI partition you say. What can I do with an EFI partition?

Well, if your machine has UEFI it means you can boot in EFI mode (rather than legacy BIOS mode). That's all. It just depends on how you want to boot the machine.

I do not understand what you said:

PS If you go GPT and boot in BIOS mode, you might want to create a bios boot partition in case you ever do wish to use grub. This only needs to be 1-2M.

Do I have to create another partition if I use GPT? As I have read  bios partition is used by standard BIOS-based machines in order to boot when the partition table of the device is a GPT label. So If I do not create a bios partition, arch in external hdd will not boot right? How can I create a bios partition? I have to create this during arch installation, before arch installation, or after arch installation?

You create it when you partition. You can do this before installing Arch - either using a separate tool or from the Arch installation media. Whether you need it depends on whether you might want to use grub. If you use syslinux, say, it isn't necessary. If you do need one, you just create the partition the way you would any partition and give it the relevant type code. That's all.

The wiki has all of the information you need on this topic - please take a look there.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2013-09-14 21:55:49

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

cfr wrote:
toni wrote:

Sorry by my ignorance, but is it possible to have 2 boot partitions? I mean, \boot and that EFI partition you say. What can I do with an EFI partition?

Well, if your machine has UEFI it means you can boot in EFI mode (rather than legacy BIOS mode). That's all. It just depends on how you want to boot the machine.

I do not understand what you said:

PS If you go GPT and boot in BIOS mode, you might want to create a bios boot partition in case you ever do wish to use grub. This only needs to be 1-2M.

Do I have to create another partition if I use GPT? As I have read  bios partition is used by standard BIOS-based machines in order to boot when the partition table of the device is a GPT label. So If I do not create a bios partition, arch in external hdd will not boot right? How can I create a bios partition? I have to create this during arch installation, before arch installation, or after arch installation?

You create it when you partition. You can do this before installing Arch - either using a separate tool or from the Arch installation media. Whether you need it depends on whether you might want to use grub. If you use syslinux, say, it isn't necessary. If you do need one, you just create the partition the way you would any partition and give it the relevant type code. That's all.

The wiki has all of the information you need on this topic - please take a look there.

Now I have my hdd partitioned as following:

sdc1 -> Grub bios partition (2MB)
sdc2 -> \boot partition (200MB)
sdc3 -> LVM for the rest of hdd

I took  look at arch wikis but I have one doubt:
Regarding sdc1 (grub bios partition): When I will install arch, there is a step where I tell arch which disk to install grub, in this case, sdc, but how grub knows grup partition sdc1 is there? Is it necessary in some way to link it? and during arch installation I have to mount sdc1 or is it not necessary for this partition? (Sorry I have no experience on grub bios partition)

Thanks a lot!

Last edited by toni (2013-09-14 22:35:22)

Offline

#13 2013-09-14 22:49:57

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

No you don't mount it or link it or anything. Just give it the correct type code when you create the partition. You don't even put a file system on it. grub will find it automatically and know what to do.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#14 2013-09-15 09:16:45

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

cfr wrote:

No you don't mount it or link it or anything. Just give it the correct type code when you create the partition. You don't even put a file system on it. grub will find it automatically and know what to do.

Again a lot of thanks for your time dedicated, great explanation.
Only a final suggestion: \boot partition is not better to no create as a separate parititon and create it as a logical volume under group volume? I mean, within LVM partition so the only paritions created as physical in the disc would be grub bios partition and LVM? What is best, do it as a separate parition as you said or within the LVM?

Thanks!

Offline

#15 2013-09-15 10:10:48

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

Hi, I have googled and found the answer to my own question, here there is why \boot partition is needed to be as a separate partition or not depending on the bootloader and system configuration:

http://askubuntu.com/questions/76095/what-is-the-use-of-boot-lvm-based-in-partitioning

Offline

#16 2013-09-16 00:38:21

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

http://askubuntu.com/questions/76095/wh … rtitioning

Personally, I would recommend a separate /boot as it gives you more options. You might not like grub or a bug in grub might be most easily fixed by using a different boot loader for a while. You have fewer options without the separate partition.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2013-09-16 22:26:31

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED]Create Partitions to get best hdd performance reading/writting

cfr wrote:

http://askubuntu.com/questions/76095/wh … rtitioning

Personally, I would recommend a separate /boot as it gives you more options. You might not like grub or a bug in grub might be most easily fixed by using a different boot loader for a while. You have fewer options without the separate partition.

Finally, I have successfully installed arch using LVM and a separate boot partition. It works like a charm! A lot of thanks by all your suggestions and your time spend helping me.

Offline

Board footer

Powered by FluxBB