注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Install/Prepare Disk"

From Funtoo
Jump to navigation Jump to search
m ("czech mistake")
(uefi is safe for use on legacy computers, it just needs bios boot staging ground for grub. implement /dev/funtoo drive aliasing udev rules. i need to backport the thinking about /dev/funtoo as /dev/sdX to undead)
Line 3: Line 3:
== Prepare Disk == <!--T:23-->
== Prepare Disk == <!--T:23-->
</includeonly><noinclude><languages/>
</includeonly><noinclude><languages/>
= Install Guide: Prepare Disk =  
== Install Guide: Prepare Disk ==
   
   
{{InstallNavigation|num=2|prev=Download LiveCD|next=MBR Partitioning}}</noinclude>
{{InstallNavigation|num=2|prev=Download LiveCD|next=MBR Partitioning}}</noinclude>


<!--T:24-->
<!--T:24-->
In this section, you will need to choose a disk format to use for booting and partitioning -- either MBR or UEFI/GPT. If you are not familiar with the differences between these options, please review our [[Install/Disk Formats|Disk Formats]] page for an overview of each option and the trade-offs. Generally, it's usually safe to pick the legacy MBR method for system disks under 2TB in size and most modern PC systems support MBR as well as UEFI booting.
In this section, you will need to choose a disk format to use for booting and partitioning -- either MBR or UEFI/GPT. If you are not familiar with the differences between these options, please review our [[Install/Disk Formats|Disk Formats]] page for an overview of each option and the trade-offs. Generally, it's usually safe to pick the GPT method with a BIOS Boot partition to enable legacy booting, and install UEFI.


==== But First... ==== <!--T:25-->
==== But First... ==== <!--T:25-->
Line 17: Line 17:
<!--T:27-->
<!--T:27-->
{{console|body=
{{console|body=
# ##i##lsblk
# ##i##spaceball-1 ~ # lsblk -o model,name,size,label,partlabel
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
MODEL            NAME     SIZE LABEL                    PARTLABEL
sda             8:0   0 1.8T  0 disk
ST31000340AS    sda    931.5G                         
├─sda1          8:1    0  512M  0 part
                └─sda1 931.5G HOME                   
├─sda2          8:2   0   8G 0 part [SWAP]
PNY CS900 120GB sdb    111.8G                         
└─sda3          8:3   0  1.8T 0 part
                ├─sdb1    1M                          BIOS Boot
   ├─main-root 254:0    0  500G  0 lvm  /
                ├─sdb2  256M BOOTF                    BOOTF
  └─main-data 254:1    0  1.3T  0 lvm  /home
                └─sdb3 111.6G FUNTOOL                  FUNTOOL
USB 2.0 FD      sdc      3.8G Ubuntu 20.04.1 LTS amd64
                ├─sdc1  2.6G Ubuntu 20.04.1 LTS amd64
                └─sdc2  3.9M                         
Portable        sdd      1.8T                        
                └─sdd1   1.8T Seagate Portable Drive 
}}
}}


<!--T:30-->
<!--T:30-->
{{Note|If you're not sure which disks are which, you can use {{c|lsblk -o MODEL,NAME,SIZE}} to show the device models matching the {{c|/dev/sd?}} names.}}
Now that we know what drive we're targeting to install, we will set udev rules to alias the drive as /dev/funtoo, and partitions as /dev/funtoo1 /dev/funtoo2 etc.  undead usb uses the second official partitioning scheme, which is swapless, the official install guide uses the first official partitioning scheme with a swap partition to avoid the performance hit from mounting swap by file.


<!--T:28-->
<!--T:28-->
Make sure you will not be overwriting any important data and that you have chosen the correct {{c|/dev/sd?}} device. Above, you can see that SATA disk {{c|sda}} contains three partitions, {{c|sda1}}, {{c|sda2}} and {{c|sda3}}, and that {{c|sda3}} contains LVM volumes. If you are using an NVME disk, then you may see {{c|nvme0n1}} as your disk, and your partitions (if any exist yet) will be named {{c|nvme0n1p1}}, {{c|nvme0n1p2}}, etc. If you are installing on microSD Card for Raspberry Pi, your disk will likely be {{c|mmcblk0}} and partitions will have suffixes {{c|p1}}, {{c|p2}}, etc.
====The first rule of funtoo is funtoo rules.====
 
*ide drive #3 example:
{{console|body=
###i## echo 'KERNEL=="hdd*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
}}
 
*sata drive #2 example:
{{console|body=
###i## echo 'KERNEL=="sdc*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
}}
 
*nvme nvme drive 1 example:
{{console|body=
###i## echo 'KERNEL=="nvme1n1", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
###i## echo 'KERNEL=="nvme1n1p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
}}
 
*mmc drive 0 example:
{{console|body=
###i## echo 'KERNEL=="mmcblk0", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
###i## echo 'KERNEL=="mmcblk0p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
}}
 
{{console|body=
###i## udevadm control --reload-rules && udevadm trigger
}}


<!--T:29-->
<!--T:29-->
Once you've double-checked your target block device and made sure you'll be partitioning the correct disk, proceed to the next step.
I need to mount the 1.8tb usb drive today, notice I leave the star for /dev/funtoo2 to point to /dev/sdd2
*sata drive #2 example modified to load /dev/sdd:
{{console|body=
###i## echo 'KERNEL=="sdd*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
###i## udevadm control --reload-rules && udevadm trigger
}}
Now running {{c|ls -al /dev/funtoo}} will point to my drive that I am targeting to install. {{c|/dev/funtoo -> sdd}}
*you can think of /dev/funtoo as /dev/sdX install instructions, but were mounting our drive were installing to /dev/sdX so everything on the install is copy paste, and safely pointed away from drives you might care about.
</translate>
</translate>
<noinclude>{{InstallNavigation|num=2|prev=Download LiveCD|next=MBR Partitioning|align=right}}</noinclude>
<noinclude>{{InstallNavigation|num=2|prev=Download LiveCD|next=MBR Partitioning|align=right}}</noinclude>

Revision as of 09:06, December 7, 2020

Other languages:
English • ‎español • ‎français • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎ • ‎中文(台灣)‎

Install Guide: Prepare Disk

Install Guide, Chapter 2 < Prev Next >

In this section, you will need to choose a disk format to use for booting and partitioning -- either MBR or UEFI/GPT. If you are not familiar with the differences between these options, please review our Disk Formats page for an overview of each option and the trade-offs. Generally, it's usually safe to pick the GPT method with a BIOS Boot partition to enable legacy booting, and install UEFI.

But First...

Before doing anything to your disks, make sure you are partitioning the right one. Use the lsblk command to view a list of all block devices on your system, as well as partitions on these block devices:

root # spaceball-1 ~ # lsblk -o model,name,size,label,partlabel
MODEL            NAME     SIZE LABEL                    PARTLABEL
ST31000340AS     sda    931.5G                          
                 └─sda1 931.5G HOME                     
PNY CS900 120GB  sdb    111.8G                          
                 ├─sdb1     1M                          BIOS Boot
                 ├─sdb2   256M BOOTF                    BOOTF
                 └─sdb3 111.6G FUNTOOL                  FUNTOOL
USB 2.0 FD       sdc      3.8G Ubuntu 20.04.1 LTS amd64 
                 ├─sdc1   2.6G Ubuntu 20.04.1 LTS amd64 
                 └─sdc2   3.9M                          
Portable         sdd      1.8T                          
                 └─sdd1   1.8T Seagate Portable Drive

Now that we know what drive we're targeting to install, we will set udev rules to alias the drive as /dev/funtoo, and partitions as /dev/funtoo1 /dev/funtoo2 etc. undead usb uses the second official partitioning scheme, which is swapless, the official install guide uses the first official partitioning scheme with a swap partition to avoid the performance hit from mounting swap by file.

The first rule of funtoo is funtoo rules.

  • ide drive #3 example:
root # echo 'KERNEL=="hdd*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
  • sata drive #2 example:
root # echo 'KERNEL=="sdc*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
  • nvme nvme drive 1 example:
root # echo 'KERNEL=="nvme1n1", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
root # echo 'KERNEL=="nvme1n1p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
  • mmc drive 0 example:
root # echo 'KERNEL=="mmcblk0", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
root # echo 'KERNEL=="mmcblk0p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
root # udevadm control --reload-rules && udevadm trigger

I need to mount the 1.8tb usb drive today, notice I leave the star for /dev/funtoo2 to point to /dev/sdd2

  • sata drive #2 example modified to load /dev/sdd:
root # echo 'KERNEL=="sdd*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
root # udevadm control --reload-rules && udevadm trigger

Now running ls -al /dev/funtoo will point to my drive that I am targeting to install. /dev/funtoo -> sdd

  • you can think of /dev/funtoo as /dev/sdX install instructions, but were mounting our drive were installing to /dev/sdX so everything on the install is copy paste, and safely pointed away from drives you might care about.
Install Guide, Chapter 2 < Prev Next >