부팅 가능한 파티션 명령줄 설정

부팅 가능한 파티션 명령줄 설정

parted에서 명령줄을 사용하여 부팅 가능한 파티션을 설정하는 방법은 무엇입니까?

이상적으로는 부팅할 파티션을 쉽게 선택할 수 있도록 번호가 매겨진 목록을 원합니다.

답변1

저는 fdisk를 사용합니다. 이 방법을 적용하기 전에 Live CD 또는 USB를 사용하고 데이터를 백업하는 것이 좋습니다.

먼저 "/dev/sda1"과 같은 부팅 가능한 파티션이 내 시스템에 부팅 가능한 파티션인지 확인하세요.

fdisk -l /dev/sda                                                      

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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 identifier: 0x00003256

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1    *       2048   959991807   479994880   83  Linux
/dev/sda2       959993854   976766975     8386561    5  Extended
/dev/sda5       959993856   976766975     8386560   82  Linux swap / Solaris

부팅 파티션이 없으면 루트로 로그인합니다.

fdisk  /dev/sda
Command (m for help): m

Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): a
Partition number (1-5): 

파티션 1을 부팅 가능하게 하려면 1을 입력해야 하고, 두 번째 파티션을 부팅 가능하게 하려면 2를 입력해야 합니다.

이렇게 "w"를 사용하여 수정하세요.

Command (m for help): w

디스크 테이블을 수정하고 필요한 파티션을 부팅 가능하게 만드는 데 사용됩니다.

도움이 되길 바랍니다

답변2

print명령을 사용하면 파티션 번호(첫 번째 열)를 얻을 수 있습니다. 1이라고 가정합니다. 부팅 가능하게 만듭니다.

(parted) set 1 boot on

답변3

운영 체제https://qwiek.wordpress.com/그런 다음 "fdisk"를 사용하여 flag 1첫 번째 파티션을 부팅 가능하게 만듭니다.

관련 정보