Handbook Talk:Alpha/Installation/Disks

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using ~~~~:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC)
: A reply [[User:Sally|Sally]] 12:44, 16 March 2025 (UTC)
:: Your reply ~~~~

fdisk broken on Alpha

Talk status
This discussion is done as of 2025-02-23.

Hi,

In section "Deleting all slices" fdisk is used to create a bsd disklabel. fdisk is broken on alpha (since a while back) and will probably not get fixed. I believe using parted is the best way to create a bsd disklabel on a disk which does not already have a valid bsd label. I don't have the permissions to edit the handbooks but I remember getting stuck on this one a while back when I forgot about the brokenness of fdisk on alpha.

Thanks for reporting, we use a system where prepose changes using the Template:Proposal system. An example of how we do this can be found at Handbook_Talk:AMD64/Installation/Tools#Add_a_NetworkManager_in_section_Networking_tools
Would you be able to write us up a quick draft of this change please and I'll get to work on getting the correct people seeing this to make it happen.
Feel free to report as many issues as you find in the Alpha section as it's high on my list to bring these docs up to date, however I currently don't have hardware.
Immolo (talk) 12:32, 21 February 2025 (UTC)


In order to create a bsd disklabel parted must be used since fdisk is broken in that sense, once we have the disklabel in place we can continue using fdisk to create all the slices Lindholm (talk) 13:39, 22 February 2025 (UTC)

Proposed changes to section Handbook:Alpha/Installation/Disks#Deleting_all_slices - Please make edits here until a final revision is agreed upon.

.

Creating a BSD disklabel

If the hard drive is completely blank, then first create a BSD disklabel. On alpha, this can't be done using fdisk, so using parted is the way forward here.

Now fire up parted:

root #parted /dev/sda
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)mklabel bsd
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes                                                               
(parted) quit                                                             
Information: You may need to update /etc/fstab.


Now that we have a bsd disklabel on our drive, continue creating slices. This can be done using parted, or as in the examples below, using fdisk:


root #fdisk /dev/sda

Deleting all slices

.
Added in Special:Diff/1273120/1343937, thanks!
--csfore (talk) 17:09, 23 February 2025 (UTC)

create a separete /boot partition

Talk status
This discussion is done as of 2025-02-23.

Current gentoo installation follows the "merged-usr" file system layout. However, the aboot boot loader only supports ext2 and ext3 file systems. Using a small /boot partition for kernels and the aboot.conf file, lets the user select other modern file systems for the root file system containing the rest of the system files. Suggestion: add a section about creating a /boot partition separate from root file system to better reflect the "merged-usr" file system layout. This also means that the handbook needs to be adjusted to reflect that, in this example, root file system is in now on sda4 and that sda2 need to be mounted in /boot, also aboot.conf will reside in /boot not in /etc.

Lindholm (talk) 23:21, 22 February 2025 (UTC)

Proposed changes to section Handbook:Alpha/Installation/Disks#Creating_the_root_slice - Please make edits here until a final revision is agreed upon.

.

Creating the swap slice

On Alpha based systems there is no need for a separate boot slice, but in this example we will create a separate /boot slice to hold the kernels and boot loader configuration files also, the first cylinder cannot be used as the aboot image will be placed there.


We will create a swap slice starting at the third cylinder, with a total size of 1 GB. Use n to create a new slice. After creating the slice, we will change its type to 1 (one), meaning swap.


BSD disklabel command (m for help):n
Partition (a-p): a
First cylinder (1-5290, default 1): 3
Last cylinder or +size or +sizeM or +sizeK (3-5290, default 5290): +1024M


BSD disklabel command (m for help):t
Partition (a-c): a
Hex code (type L to list codes): 1


After these steps a layout similar to the following should be shown:


BSD disklabel command (m for help):p
3 partitions:
#       start       end      size     fstype   [fsize bsize   cpg]                                    
  a:        3      1003      1001       swap
  c:        1      5290*     5289*    unused        0     0

Creating the boot slice

Create a boot file system containing the kernels and boot loader configuration file (aboot.conf). aboot supports ext2 and ext3 filesystems only. Create the boot slice starting from the first cylinder after the swap slice. Use the p command to view where the swap slice ends. In our example, this is at 1003, making the boot slice start at 1004.


BSD disklabel command (m for help):n
Partition (a-p): b
First cylinder (1-5290, default 1): 1004
Last cylinder or +size or +sizeM or +sizeK (3-5290, default 5290): +1024M


BSD disklabel command (m for help):t
Partition (a-c): b
Hex code (type L to list codes): 08

After these steps a layout similar to the following should be shown:


BSD disklabel command (m for help):p
3 partitions:
#       start       end      size     fstype   [fsize bsize   cpg]                                    
  a:        3      1003      1001       swap
  b:     1004      2005      1001       ext2
  c:        1      5290*     5289*    unused        0     0


Creating the root slice

We will now create the root slice, starting from the first cylinder after the boot slice. Use the p command to view where the boot slice ends. In our example, this is at 2005, making the root slice start at 2006.


Another problem is that there is currently a bug in fdisk making it think the number of available cylinders is one above the real number of cylinders. In other words, when asked for the last cylinder, decrease the cylinder number (in this example: 5290) with one.

When the slice is created, we change the type to 8, for ext2.


BSD disklabel command (m for help):n
Partition (a-p): b
First cylinder (1-5290, default 1): 2006
Last cylinder or +size or +sizeM or +sizeK (1004-5290, default 5290): 5289


BSD disklabel command (m for help):t
Partition (a-c): b
Hex code (type L to list codes): 8


The resulting slice layout should now be similar to this:


BSD disklabel command (m for help):p
3 partitions:
#       start       end      size     fstype   [fsize bsize   cpg]                                    
  a:        3      1003      1001       swap
  b:     1004      2005      4286       ext2
  c:        1      5290*     5289*    unused        0     0
  d:     2006      5289      3283       ext2

Save the slice layout and exit

Exit the fdisk application by typing w. This will also save the slice layout.


Command (m for help):w
Added in Special:Diff/1343937/1343939, thanks!
--csfore (talk) 17:16, 23 February 2025 (UTC)