Difference between pages "Install/ru/Partitioning" and "News:New Media Mix-ins"

From Funtoo
< Install‎ | ru(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
<noinclude>
{{News
{{InstallPart|процесс разбиения диска и создания файловых систем}}
|Summary=Funtoo Linux now has new media mix-ins. Learn about them and how to use them.
</noinclude>
|News Format=Extended
=== Подготовка жесткого диска ===
|News Category=General
 
|Author=Drobbins
В этой части  мы научимся различным способам установки Funtoo Linux -- и загрузки с -- жесткого диска.
|Publication Status=Published
 
|Publication Date=2015/01/11
==== Введение ====
}}
 
Hello everyone,
В прежние времена существовал лишь один способ загрузить PC-совместимый компьютер. Все наши дектопы и сервера имели стандартный PC BIOS, все наши харды использовали MBR и были разбиты используя схему разбивки MBR.  Вот как это все было и нам это нравилось!
 
Затем появились EFI и UEFI,  встроенные программы нового образца наряду со схемой разбивки GPT, поддерживающая диски размером более 2.2TБ. Неожиданно, нам стали доступны различные способы установки и загрузки Линукс систем . То, что было единым методом, стало чем-то более сложным.
 
Воспользуемся моментом и рассмотрим доступные способы конфигурации жесткого диска для загрузки Funtoo Linux. Данное Руководство рекомендует способ "по-старинке" , загрузка BIOS и использование MBR.  Данный способ работает (за исключением редких случаев) и всесторонне поддерживается. И в этом нет ничего плохого. Если Ваш жесткий диск 2TБ или меньшего размера это не является препятствием для использования всего дискового пространства.
 
Но, бывают ситуации когда метод "по-старинке"  не является оптимальным. Если Ваш жесткий диск размером более 2TБ , MBR разбивка не сможет обеспечить доступ ко всему дисковому пространству.  Это одна из причин.  Вторая причина: существуют  "PC" системы, которые более не поддерживают  BIOS загрузку  и  форсируют UEFI загрузку. Из чувства сострадания к тем, кто попал в затруднение перед выбором, это Руководство также описывает установку и загрузку UEFI систем.
 
Мы всё же рекомендуем разбивку "по-старинке". Загрузчик, который мы используем для загрузки Линукс в этом руководстве называется GRUB,  таки образом мы называем метод  как '''BIOS + GRUB (MBR)''' . Это традиционный способ установки на PC-совместимые компьютеры.
 
Если Вам необходимо использование UEFI для загрузки, мы советуем не использовать MBR вообще, ввиду того, что некоторые системы поддерживают MBR,  а некоторые нет. Вместо, мы советуем использование UEFI  для загрузки GRUB, который, затем в свою очередь загрузит Линукс. Мы называем этот  метод как '''UEFI + GRUB (GPT)'''.
 
И да, есть еще несколько способов, некоторые из них задокументированы в [[Boot Methods]] . Обычно мы рекомендуем  '''BIOS + GRUB (GPT)''' метод, но он ограничивается не столь широкой поддержкой со стороны комплектующих.
 
'''Вопрос --  какой из методов использовать?'''  Вот какой.
 
;Принцип 1 - "По-старинке":  Если Вы можете успешно загрузить System Rescue CD и видите синее меню, то Вы используете BIOS,  и скорее всего Вы можете загрузить Funtoo Linux используя BIOS. Итак,  следуйте этому способу и используйте BIOS загрузку,  кроме случаев Вам по-какой либо причине необходим UEFI, например если размер жесткого диска >2.2TБ.  В этом случае следуйте Принцип  2.
 
;Принцип 2 - "Модерн":  Если Вы можете успешно загрузить System Rescue CD и видите черно-белое меню -- поздравления,  Ваша система поддерживает UEFI загрузку. Это значит, что Вы готовы установить Funtoo Linux к загрузке с помощью UEFI.  Ваша система также может поддерживать загрузку BIOS,  но попрбуйте UEFI для начала. Вы можете "покопаться" в настройках BIOS.
 
;Какая разница между "По-старинке" и "Модерн"?:  Если Вы следуете  MBR разбивке, Ваш <code>/boot</code> раздел будет отформатирован файловой системой ext2 , и Вы будете использовать <code>fdisk</code> для создания MBR разделов.  Если Вы следуете "модерн", GPT разделам и UEFI загрузке,  Ваш <code>/boot</code> раздел будет отформатирован  в файловую систему vfat,  поскольку это единственная файловая система поддерживаемая UEFI, и Вы будете использовать <code>gdisk</code> для создания GPT разделов.  И Вы установите GRUB несколько иначе.  Вот к чему сводится различие между методами.
 
;Имейте в виду: Для установки Funtoo Linux используя метод "модерн", Вы должны загрузить System Rescue CD в UEFI режиме -- и увидеть начальное черно-белое меню. В противном случае, UEFI не активно и Вы не сможете продолжить!
 
{{Note|'''Некоторые материнские платы якобы поддерживают UEFI, но на самом деле нет.''' Исследуйте . К примеру,  Award BIOS в моей Gigabyte GA-990FXA-UD7 rev 1.1 имеет возможность включить UEFI загрузку для CD/DVD. '''Этого не достаточно для обеспечения UEFI загрузки для жестких дисков и установки Funtoo Linux.''' UEFI должно поддерживать и сьемные носители (таким образом Вы сможете загрузить System Rescue CD используя  UEFI) и жесткие диски (Вы можете загрузить Funtoo Linux.) Оказывается, что более поздние ревизии этой платы (rev 3.0) имеют новую версию BIOS который полностью поддерживает UEFI.  Это приводит к третьему принципу -- знайте Ваши комплектующие.}}
 
==== Метод (BIOS/MBR) "По-старинке" ====
 
{{Note|Используйте данный метод при загрузке с помощью BIOS,  и если System Rescue CD имеет начальное меню загрузки светло-голубое.  Если Вы собираетесь использовать "модерн", [[#Метод (UEFI/GPT) "Модерн"|кликните здесь в меню UEFI/GPT.]]}}
 
===== Подготовка =====
 
Прежде чем начать , неплохо бы удостовериться, что Вы используете нужный диск для разбивки.  Попробуйте эту комманду и проверьте, что <code>/dev/sda</code> тот самый диск, который Вы желаете разбить:
 
<console>
# ##i##fdisk -l /dev/sda
 
Disk /dev/sda: 640.1 GB, 640135028736 bytes, 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
 
 
#        Start          End    Size  Type            Name
1        2048  1250263694  596.2G  Linux filesyste Linux filesystem
</console>
 
Теперь, рекомендуем стереть  существующие таблицы разделов  MBR или GPT, которые могут помешать BIOS во время загрузки. Мы используем комманду <code>sgdisk</code>:
{{fancywarning|Это необратимый процесс, который уничтожит все разделы!  Вы предупреждены! Советуем сохранить критические данние перед этим.}}


<console>
Funtoo Linux has amazing support for all different kinds of audio, video and graphics formats, as well as media devices that can be enabled via USE flags -- but let's face it  -- with all this flexibility has come a certain amount of complexity in enabling all the USE flags you need for a particular application. I've tried to address this by [[Funtoo Profiles|enhancing the profile system]] to include flavors and mix-ins, and creating a {{c|media}} mix-in that enables stuff that a lot of people will want, which is auto-enabled in the {{c|desktop}} and {{c|workstation}} profile. But I always knew that this, while an improvement, was not the final word on media support in Funtoo Linux, and that we needed to do more work here.
# ##i##sgdisk --zap-all /dev/sda


Creating new GPT entries.
Recently, thanks to assistance from [[User:Mgorny|Michał Górny]], we have been able to implement my design for second-generation media support to Funtoo Linux! Here's how it works. Rather than have a single mix-in called "media", we now have finer-grained categories, and the existing {{c|media}} mix-in has been upgraded to pull in a subset of these categories. Let's look at all the new mix-ins:
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
</console>


Не стоит беспокоится об этом сообщении, так как комманда успешно выполнена:
=== Media Device Mix-ins ===


<console>
Media device mix-ins have been created to support media devices, including external and portable devices, and associated low-level hardware support and hardware-focused codecs. Media devices have been categorized into audio and video categories, and consumer and professional categories. "Consumer" devices are those devices that regular desktop users might typically use, while "professional" devices are those that professionals, hobbyists or enthusiasts would typically use. Here are the new mix-ins for media devices:
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.  
***************************************************************
</console>


===== Partitioning =====
{{TableStart}}
<tr><th class="active">Mix-in</th><th class="active">Description</th></tr>
<tr><td>{{c|mediadevice-base}}</td><td>Common, universally-supported media devices, like IEEE-1394 (Firewire), CDDA, CDIO. Other mediadevice mix-ins have this as a parent.</td></tr>
<tr><td>{{c|mediadevice-audio-consumer}}</td><td>Consumer audio devices, such as personal portable media players (iOS, iPod, etc.)</td></tr>
<tr><td>{{c|mediadevice-audio-pro}}</td><td>Pro audio support, such as JACK.</td></tr>
<tr><td>{{c|mediadevice-video-consumer}}</td><td>Consumer video support, such as DVD, Blu Ray, V4L</td></tr>
<tr><td>{{c|mediadevice-video-pro}}</td><td>Pro video support, such as dv, dc1394.</td></tr>
{{TableEnd}}


Now we will use <code>fdisk</code> to create the MBR partition table and partitions:
=== Media Format Mix-ins ===


<console>
Media format mix-ins have been created to support media formats for reading, writing, encoding and decoding images, audio and video. They have been organized into a "common" collection, for popular formats, and an "extra" collection, which is intended to include "everything else". Let's look at the new mix-ins:
# ##i##fdisk /dev/sda
</console>


Within <code>fdisk</code>, follow these steps:
{{TableStart}}
<tr><th class="active">Mix-in</th><th class="active">Description</th></tr>
<tr><td>{{c|mediaformat-video-common}}</td><td>Common (ie. popular) video formats.</td></tr>
<tr><td>{{c|mediaformat-video-extra}}</td><td>More esoteric video formats.</td></tr>
<tr><td>{{c|mediaformat-audio-common}}</td><td>Common (ie. popular) audio formats.</td></tr>
<tr><td>{{c|mediaformat-audio-extra}}</td><td>More esoteric audio formats.</td></tr>
<tr><td>{{c|mediaformat-gfx-common}}</td><td>Common (ie. popular) graphics formats.</td></tr>
<tr><td>{{c|mediaformat-gfx-extra}}</td><td>More esoteric graphics formats.</td></tr>
{{TableEnd}}


'''Empty the partition table''':
=== How to Use Them ===


<console>
Our existing {{c|media}} mix-in still exists, and is still pulled in by the {{c|desktop}} and {{c|workstation}} flavors automatically. It now includes the following parent mix-ins:
Command (m for help): ##i##o ↵
</console>
 
'''Create Partition 1''' (boot):
 
<console>
Command (m for help): ##i##n ↵
Partition type (default p): ##i##↵
Partition number (1-4, default 1): ##i##↵
First sector: ##i##↵
Last sector: ##i##+128M ↵
</console>
 
'''Create Partition 2''' (swap):
 
<console>
Command (m for help): ##i##n ↵
Partition type (default p): ##i##↵
Partition number (2-4, default 2): ##i##↵
First sector: ##i##↵
Last sector: ##i##+2G ↵
Command (m for help): ##i##t ↵
Partition number (1,2, default 2): ##i## ↵
Hex code (type L to list all codes): ##i##82 ↵
</console>
 
'''Create the root partition:'''
 
<console>
Command (m for help): ##i##n ↵
Partition type (default p): ##i##↵
Partition number (3,4, default 3): ##i##↵
First sector: ##i##↵
Last sector: ##i##↵
</console>
 
'''Verify the partition table:'''
 
<console>
Command (m for help): ##i##p
 
Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x82abc9a6
 
Device    Boot    Start      End    Blocks  Id System
/dev/sda1          2048    264191    131072  83 Linux
/dev/sda2        264192  4458495  2097152  82 Linux swap / Solaris
/dev/sda3        4458496 625142447 310341976  83 Linux
</console>
 
'''Write the parition table to disk:'''
 
<console>
Command (m for help): ##i##w
</console>
 
Your new MBR partition table will now be written to your system disk.
 
{{Note|You're done with partitioning! Now, jump over to [[#Creating filesystems|Creating filesystems]].}}
 
==== New-School (UEFI/GPT) Method ====
 
{{Note|Use this method if you are booting using UEFI, and if your System Rescue CD initial boot menu was black and white. If it was light blue, this method will not work.}}
 
The <tt>gdisk</tt> commands to create a GPT partition table are as follows. Adapt sizes as necessary, although these defaults will work for most users. Start <code>gdisk</code>:
 
<console>
# ##i##gdisk
</console>
 
Within <tt>gdisk</tt>, follow these steps:
 
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):
 
<console>
Command: ##i##o ↵
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): ##i##y ↵
</console>
 
'''Create Partition 1''' (boot):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##1 ↵
First sector: ##i##↵
Last sector: ##i##+500M ↵
Hex Code: ##i##↵
</console>
 
'''Create Partition 2''' (swap):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##2 ↵
First sector: ##i##↵
Last sector: ##i##+4G ↵
Hex Code: ##i##8200 ↵
</console>
 
'''Create Partition 3''' (root):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##3 ↵
First sector: ##i##↵
Last sector: ##i##↵##!i## (for rest of disk)
Hex Code: ##i##↵
</console>
 
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:
 
'''Write Partition Table To Disk''':
 
<console>
Command: ##i##w ↵
Do you want to proceed? (Y/N): ##i##Y ↵
</console>
 
The partition table will now be written to disk and <tt>gdisk</tt> will close.
 
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:
 
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem,
* <tt>/dev/sda2</tt>, which will be used for swap space, and
* <tt>/dev/sda3</tt>, which will hold your root filesystem.
 
==== Creating filesystems ====
 
{{Note|This section covers both BIOS ''and'' UEFI installs. Don't skip it!}}
 
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.
 
Let's keep this simple. Are you using old-school MBR partitions? If so, let's create an ext2 filesystem on /dev/sda1:
 
<console>
# ##i##mkfs.ext2 /dev/sda1
</console>
 
If you're using new-school GPT partitions for UEFI, you'll want to create a vfat filesystem on /dev/sda1, because this is what UEFI is able to read:
 
<console>
# ##i##mkfs.vfat -F 32 /dev/sda1
</console>
 
Now, let's create a swap partition. This partition will be used as disk-based virtual memory for your Funtoo Linux system.
 
You will not create a filesystem on your swap partition, since it is not used to store files. But it is necessary to initialize it using the <code>mkswap</code> command. Then we'll run the <code>swapon</code> command to make your newly-initialized swap space immediately active within the live CD environment, in case it is needed during the rest of the install process:
 
<console>
# ##i##mkswap /dev/sda2
# ##i##swapon /dev/sda2
</console>
 
Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4 or XFS root filesystems. If you're not sure, choose ext4. Here's how to create a root ext4 filesystem:
 
<console>
# ##i##mkfs.ext4 /dev/sda3
</console>
 
...and here's how to create an XFS root filesystem, if you choose to use XFS:
 
<console>
# ##i##mkfs.xfs /dev/sda3
</console>
 
Your filesystems (and swap) have all now been initialized, so that that can be mounted (attached to your existing directory heirarchy) and used to store files. We are ready to begin installing Funtoo Linux on these brand-new filesystems.
 
{{fancywarning|1=
When deploying an OpenVZ host, please use ext4 exclusively. The Parallels development team tests extensively with ext4, and modern versions of <code>openvz-rhel6-stable</code> are '''not''' compatible with XFS, and you may experience kernel bugs.
}}


==== Mounting filesystems ====
* {{c|mediadevice-audio-consumer}}
* {{c|mediadevice-video-consumer}}
* {{c|mediaformat-audio-common}}
* {{c|mediaformat-gfx-common}}
* {{c|mediaformat-video-common}}


Mount the newly-created filesystems as follows, creating <code>/mnt/funtoo</code> as the installation mount point:
In addition, there is a new {{c|media-pro}} mix-in which needs to be enabled manually, which pulls in the following mix-ins:


<console>
* {{c|mediadevice-audio-pro}}
# ##i##mkdir /mnt/funtoo
* {{c|mediadevice-video-pro}}
# ##i##mount /dev/sda3 /mnt/funtoo
# ##i##mkdir /mnt/funtoo/boot
# ##i##mount /dev/sda1 /mnt/funtoo/boot
</console>


Optionally, if you have a separate filesystem for <code>/home</code> or anything else:
So typically, you would enable the {{c|desktop}} or {{c|workstation}} flavor, and if you need professional hardware support, you'd also enable the {{c|media-pro}} mix-in. If you needed any additional media formats support, you could enable one or more of the {{c|mediaformat-*-extra}} mix-ins to add the formats you needed. Of course, it's possible to enable only the specific mix-ins you need, and also complement these mix-ins with specific USE variable settings you might require.


<console>
If you're new to Funtoo Profiles, see the [[Funtoo Profiles]] pages for more information on how they work.
# ##i##mkdir /mnt/funtoo/home
# ##i##mount /dev/sda4 /mnt/funtoo/home
</console>


If you have <code>/tmp</code> or <code>/var/tmp</code> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:
=== Conclusion ===


<console>
Going forward, these mix-ins can be maintained to include new USE flags that are created, providing an easy way for people to enable the features they need without looking through long lists of USE variables. I hope you like the new system!
# ##i##chmod 1777 /mnt/funtoo/tmp
{{NewsFooter}}
</console>

Latest revision as of 07:15, January 11, 2015

New Media Mix-ins

Funtoo Linux now has new media mix-ins. Learn about them and how to use them.

By Drobbins / January 11, 2015

Hello everyone,

Funtoo Linux has amazing support for all different kinds of audio, video and graphics formats, as well as media devices that can be enabled via USE flags -- but let's face it -- with all this flexibility has come a certain amount of complexity in enabling all the USE flags you need for a particular application. I've tried to address this by enhancing the profile system to include flavors and mix-ins, and creating a media mix-in that enables stuff that a lot of people will want, which is auto-enabled in the desktop and workstation profile. But I always knew that this, while an improvement, was not the final word on media support in Funtoo Linux, and that we needed to do more work here.

Recently, thanks to assistance from Michał Górny, we have been able to implement my design for second-generation media support to Funtoo Linux! Here's how it works. Rather than have a single mix-in called "media", we now have finer-grained categories, and the existing media mix-in has been upgraded to pull in a subset of these categories. Let's look at all the new mix-ins:

Media Device Mix-ins

Media device mix-ins have been created to support media devices, including external and portable devices, and associated low-level hardware support and hardware-focused codecs. Media devices have been categorized into audio and video categories, and consumer and professional categories. "Consumer" devices are those devices that regular desktop users might typically use, while "professional" devices are those that professionals, hobbyists or enthusiasts would typically use. Here are the new mix-ins for media devices:

Mix-inDescription
mediadevice-baseCommon, universally-supported media devices, like IEEE-1394 (Firewire), CDDA, CDIO. Other mediadevice mix-ins have this as a parent.
mediadevice-audio-consumerConsumer audio devices, such as personal portable media players (iOS, iPod, etc.)
mediadevice-audio-proPro audio support, such as JACK.
mediadevice-video-consumerConsumer video support, such as DVD, Blu Ray, V4L
mediadevice-video-proPro video support, such as dv, dc1394.

Media Format Mix-ins

Media format mix-ins have been created to support media formats for reading, writing, encoding and decoding images, audio and video. They have been organized into a "common" collection, for popular formats, and an "extra" collection, which is intended to include "everything else". Let's look at the new mix-ins:

Mix-inDescription
mediaformat-video-commonCommon (ie. popular) video formats.
mediaformat-video-extraMore esoteric video formats.
mediaformat-audio-commonCommon (ie. popular) audio formats.
mediaformat-audio-extraMore esoteric audio formats.
mediaformat-gfx-commonCommon (ie. popular) graphics formats.
mediaformat-gfx-extraMore esoteric graphics formats.

How to Use Them

Our existing media mix-in still exists, and is still pulled in by the desktop and workstation flavors automatically. It now includes the following parent mix-ins:

  • mediadevice-audio-consumer
  • mediadevice-video-consumer
  • mediaformat-audio-common
  • mediaformat-gfx-common
  • mediaformat-video-common

In addition, there is a new media-pro mix-in which needs to be enabled manually, which pulls in the following mix-ins:

  • mediadevice-audio-pro
  • mediadevice-video-pro

So typically, you would enable the desktop or workstation flavor, and if you need professional hardware support, you'd also enable the media-pro mix-in. If you needed any additional media formats support, you could enable one or more of the mediaformat-*-extra mix-ins to add the formats you needed. Of course, it's possible to enable only the specific mix-ins you need, and also complement these mix-ins with specific USE variable settings you might require.

If you're new to Funtoo Profiles, see the Funtoo Profiles pages for more information on how they work.

Conclusion

Going forward, these mix-ins can be maintained to include new USE flags that are created, providing an easy way for people to enable the features they need without looking through long lists of USE variables. I hope you like the new system!