한국어
Embedded
 

fdisk로 부팅 가능한 sd카드 파티션을 생성

 
sd카드 장착 umount 해야함
 
$ sudo fdisk /dev/sdb
 
Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
새로운 파티션 테이블 만들기
Command (m for help): o
Created a new DOS disklabel with disk identifier 0x6e90b7a1.
 
전문가 모드
Command (m for help): x
 
Expert command (m for help): h
Number of heads (1-256, default 245): 255
 
Expert command (m for help): s
Number of sectors (1-63, default 62): 63
 
Expert command (m for help): c
Number of cylinders (1-1048576, default 966): 966
 
Expert command (m for help): r
 
첫번째 파티션 (부트파티션)
Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p):
 
Using default response p.
Partition number (1-4, default 1):
First sector (2048-15523839, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-15523839, default 15523839): 83968
 
Created a new partition 1 of type 'Linux' and of size 40 MiB.
Partition #1 contains a vfat signature.
 
Do you want to remove the signature? [Y]es/[N]o: y
 
The signature will be removed by a write command.
 
파티션 타입
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
 
부트 파티션 플래그 설정
Command (m for help): a
Selected partition 1
The bootable flag on partition 1 is enabled now.
 
두번째 파티션
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p):
 
Using default response p.
Partition number (2-4, default 2):
First sector (83969-15523839, default 86016):
Last sector, +sectors or +size{K,M,G,T,P} (86016-15523839, default 15523839):
 
Created a new partition 2 of type 'Linux' and of size 7.4 GiB.
 
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
 
파일 시스템 생성
$ sudo mkfs.vfat -s1 -F 32 -n "boot" /dev/sdb1
[sudo] password for pjk:
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
 
$ sudo mkfs.ext4 /dev/sdb2
 
 
$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 7.4 GiB, 7948206080 bytes, 15523840 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: 0x6e90b7a1
 
Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1  *     2048    83968    81921   40M  c W95 FAT32 (LBA)
/dev/sdb2       86016 15523839 15437824  7.4G 83 Linux

 

번호 제목 글쓴이 날짜 조회 수
52 [Uboot 명령어 및 환경 변수 요약]U-Boot에 Command 및 Parameter에 대한 설명 pjk 2014.01.09 10388
51 printk() makersweb 2014.02.27 5154
50 GNU C 레퍼런스 메뉴얼 - 부록 D secret makersweb 2014.02.28 5
49 임베디드 시스템 개발 환경 선택 makersweb 2014.03.05 3529
48 부트로더의 start.S 분석 file makersweb 2014.03.23 3614
47 시리얼 인터페이스 커넥터를 위한 핀아웃 file pjk 2014.10.10 4798
46 USB 핀아웃 file pjk 2014.10.11 8432
45 폴링(Polling), 인터럽트(Interrupt), DMA(Direct Memory Access) file pjk 2014.10.24 6012
44 USB OTG 기술의 개념 file pjk 2014.11.03 15254
43 실시간 운영 체제 또는 RTOS(Real Time Operating System) pjk 2014.12.02 5847
42 AVR(AT90USB162)을 USB to Serial 로 이용하기 file makersweb 2015.02.14 4821
41 ST, STM32 MCU용 ‘통합 개발 환경(IDE)’ 무료 제공 makersweb 2015.03.04 8859
40 JFlashARM으로 MCU에 bin(바이너리)다운로드 file makersweb 2015.06.07 4301
39 이클립스에서 IAR프로젝트 사용방법 file makersweb 2015.07.09 8779
38 AVRISP mkII 펌웨어 업그레이드 file makersweb 2015.07.22 6936
37 윈도우10에서 Prolific USB to Serial 드라이버 인식문제 file makersweb 2016.01.24 22792
36 STM32와 CAN(Controller Area Network) Loop Back file makersweb 2017.01.23 5415
35 STM32(Cortex-M3) 개발환경구축 with Eclipse file makersweb 2018.11.08 3591
34 yocto project, 라즈베리파이를 위한 Qt + 임베디드리눅스 빌드 file makersweb 2019.02.01 11018
33 욕토 프로젝트를 이용한 Qt SDK 빌드 for 라즈베리파이3 file makersweb 2019.03.19 3067