출처 https://yiworkdisk.netlify.app/ko/linux/install_ubuntu_hdd_hc2.html
※ MicroSD는 속도가 매우 느리다.
HDD (or SSD or USB)에 설치하면 빨라진다
1. HDD 파티션 재설정
1) HDD 파티션 확인
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 925M 0 925M 0% /dev
tmpfs 200M 3.6M 196M 2% /run
/dev/mmcblk1p2 30G 4.9G 25G 17% /
...
/dev/mmcblk1p1 128M 23M 106M 18% /media/boot
tmpfs 200M 8.0K 200M 1% /run/user/121
tmpfs 200M 4.0K 200M 1% /run/user/1001
2) HDD 파티션 재설정
$sudo fdisk -l
...
Disk /dev/sda: 298.9 GiB, 320072933376 bytes, 625142448 sectors
Disk model:
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: FA88429A-0C8A-3D4E-90A8-CDB019307B6C
$ sudo fdisk /dev/sda
Command (m for help): g
Created a new GPT disklabel (GUID: 200F0D86-C2B4-CB4A-BD51-E9F766D736FE).
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-625142414, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-625142414, default 625142414): +100G
Created a new partition 1 of type 'Linux filesystem' and of size 100 GiB.
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): p
Disk /dev/sda: 298.9 GiB, 320072933376 bytes, 625142448 sectors
Disk model:
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 200F0D86-C2B4-CB4A-BD51-E9F766D736FE
Device Start End Sectors Size Type
/dev/sda1 2048 209717247 209715200 100G Linux filesystem
Filesystem/RAID signature on partition 1 will be wiped.
Command (m for help): wq
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
※ sda1 100GB sda1를 리눅스 설치용으로 할당
2. 파티션을 EXT4로 포맷 및 마운트
1) 파티션 EXT4 포맷
$ sudo mkfs.ext4 /dev/sda
2) 파티션 마운트
$ sudo mkdir -p /home/mogibu
$ sudo mount /dev/sda /home/mogibu
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 925M 0 925M 0% /dev
tmpfs 200M 3.6M 196M 2% /run
/dev/mmcblk1p2 30G 4.9G 25G 17% /
...
/dev/mmcblk1p1 128M 23M 106M 18% /media/boot
tmpfs 200M 8.0K 200M 1% /run/user/121
tmpfs 200M 4.0K 200M 1% /run/user/1001
/dev/sda 98G 61M 93G 1% /home/mogibu
3. 설정 변경
1) 파티션 UUID 확인
$ sudo lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
...
sda
`-sda1 ext4 66c37e71-5fdd-4af1-94a2-391b5238f2c9 692.9G 0% /home/mogibu
mmcblk1
|-mmcblk1p1 vfat boot 52AA-6867 105.4M 17% /media/boot
`-mmcblk1p2 ext4 rootfs e139ce78-9841-40fe-8823-96a304a09859 24.3G 17% /
2) boot.ini 설정 변경
root 파티션의 UUID를 mmcblk1p2에서 sda1로 변경
$ sudo cp /media/boot/boot.ini /media/boot/boot.ini.orig
$ sudo nano /media/boot/boot.ini
설정 변경
# Boot Args
setenv bootargs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0 ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
==>
# Boot Args
setenv bootargs "console=tty1 console=ttySAC2,115200n8 root=UUID=66c37e71-5fdd-4af1-94a2-391b5238f2c9 rootwait ro fsck.repair=yes net.ifnames=0 ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
3) fstab 설명 변경
root 파티션 mmcblk1p2에서 sda1로 변경
$ sudo cp /etc/fstab /etc/fstab.orig
$ sudo nano /etc/fstab
설정 변경
UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
LABEL=boot /media/boot vfat defaults 0 1
==>
#UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
LABEL=boot /media/boot vfat defaults 0 1
/dev/sda / ext4 defaults,noatime 0 1
4. 루트 파티션 복사
$ sudo rsync -axv / /home/mogibu/
5. Root 파티션 확인
1) 리셋2) Root 파티션 확인
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 925M 0 925M 0% /dev
tmpfs 200M 3.6M 196M 2% /run
/dev/sda 98G 5.8G 88G 7% /
...
/dev/mmcblk1p1 128M 23M 106M 18% /media/boot
tmpfs 200M 8.0K 200M 1% /run/user/121
tmpfs 200M 4.0K 200M 1% /run/user/1001
3. 설정 변경
1) 파티션 UUID 확인
$ sudo lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
...
sda
`-sda1 ext4 66c37e71-5fdd-4af1-94a2-391b5238f2c9 618.8G 61% /home/mogibu
mmcblk1
|-mmcblk1p1 vfat boot 52AA-6867 114M 11% /media/boot
`-mmcblk1p2 ext4 rootfs e139ce78-9841-40fe-8823-96a304a09859 0 100% /
2) boot.ini 설정 변경
root 파티션의 UUID를 mmcblk1p2에서 sda로 변경
$ sudo cp /media/boot/boot.ini /media/boot/boot.ini.orig
$ sudo nano /media/boot/boot.ini
설정 변경
# Boot Args
setenv bootargs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0 ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
==>
# Boot Args
setenv bootargs "console=tty1 console=ttySAC2,115200n8 root=UUID=66c37e71-5fdd-4af1-94a2-391b5238f2c9 rootwait ro fsck.repair=yes net.ifnames=0 ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
3) fstab 설명 변경
root 파티션 mmcblk1p2에서 sda로 변경
$ sudo cp /etc/fstab /etc/fstab.orig
$ sudo nano /etc/fstab
설정 변경
UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
LABEL=boot /media/boot vfat defaults 0 1
==>
#UUID=66c37e71-5fdd-4af1-94a2-391b5238f2c9 / ext4 errors=remount-ro,noatime 0 1
LABEL=boot /media/boot vfat defaults 0 1
/dev/sda / ext4 defaults,noatime 0 1
이상해... 4. 루트 파티션 복사 좀더 알아보고...
$ sudo rsync -axv / /home/mogibu
5. Root 파티션 확인
1) 리셋
2) Root 파티션 확인
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 925M 0 925M 0% /dev
tmpfs 200M 3.6M 196M 2% /run
/dev/sda1 98G 5.8G 88G 7% /
...
/dev/mmcblk1p1 128M 23M 106M 18% /media/boot
tmpfs 200M 8.0K 200M 1% /run/user/121
tmpfs 200M 4.0K 200M 1% /run/user/1001
'IT' 카테고리의 다른 글
유튜브 광고 없이 (0) | 2022.03.05 |
---|---|
랜스타 LS-USB3.0-SATA 컨버터 (USB3.0 to SATA) (1) | 2022.02.11 |
HDD WD 구입 (1) | 2022.01.23 |
404 에러 발생시 (0) | 2021.09.24 |
windows 인증 (0) | 2021.08.27 |