
注意してください、初心者の質問です... Arch Linuxを2番目にインストールするときに、起動可能なフラグで最初のパーティションを設定することを忘れました。データを失いたくはありませんが、パーティションに起動可能フラグを追加するにはどうすればよいですか?これまでfdiskを使用していましたが、起動可能フラグを追加しようとするとエラーが発生しているようです。
[ arch /boot ]# fdisk /dev/sda1
Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
The device contains 'ext4' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xfaeee4ac.
Command (m for help): print
Disk /dev/sda1: 500 MiB, 524288000 bytes, 1024000 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: 0xfaeee4ac
Command (m for help): a
No partition is defined yet!
Command (m for help):
次にpartedを使用すると、同様のエラーが発生します(分割されていないか、間違って分割されたと思います/dev/sda1
)。
[ blackarch /boot ]# parted /dev/sda1
GNU Parted 3.5
Using /dev/sda1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: Unknown (unknown)
Disk /dev/sda1: 524MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 524MB 524MB ext4
(parted) set /dev/sda1 boot
align-check disk_toggle mklabel mktable print rescue resizepart select toggle version
disk_set help mkpart name quit resize rm set unit
(parted) set /dev/sda1 set boot on
Error: Partition doesn't exist.
(parted)
ここに解決策はありますか?私はそれが非常に簡単だと確信しています...
答え1
/dev/sda
パーティション化ツールを実行するたびに、特定のパーティションのデバイスを参照するのではなく、ディスク全体を使用する必要があります/dev/sda1
。
それ以外の場合は、実際にはパーティション内に2番目にパーティション化されたテーブルを作成するようにツールに要求します。もちろん、必要に応じてこれを行うことができますが、仮想マシンでパーティションを仮想ディスクとして使用しようとしている場合や、仮想マシンの前に仮想ディスクを実行したい場合など、非常に特別な状況を除いてはあまり役に立ちません。事前パーティションされている場合は完全にインストールされます。
パーティション化されたテーブルは通常、自分が制御する実際のパーティションの外側にあります。したがって、設定するには起動可能に表示されたら、次の/dev/sda1
いずれかを実行する必要があります。
fdisk /dev/sda
または:
parted /dev/sda
GRUBブートローダを使用してマスターブートレコードにインストールする場合は、通常、パーティションブートフラグを確認するコードが標準のWindowsマスターブートレコードのブートコードにあることに注意してください。 GRUBをMBRにインストールすると、このコードはGRUBのコードに置き換えられます。開始フラグを完全に無視します。それでも。
したがって、GRUBを使用したい場合は、ブートフラグを設定する必要はなく、システムBIOSが特定のフラグを特定しない限り、そのステップを完全にスキップできます。