Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to simply make a Linux file system on TF card

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to simply do a Linux file system on the TF card, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

How to use a simple method to quickly make a file system on a TF card? Many people must want to put the TF card on the device, then plug in a flash drive or CD, and install it after boot, but in fact, it takes a lot of time to operate a variety of options, so I'll teach you how to make a Linux file system quickly.

First of all, we need an Linux operating system to package and compress all the files under the root file of the Linux system. Forget about the packaging process, let's talk about how to restore it.

Step 1: partition the USB disk through the fdisk command

[root@localhost media] # umount / media/cdrom # (uninstall the mounted TF card) [root@localhost media] # fdisk / dev/sdd # (TF card partition) Welcome to fdisk (util-linux 2.23.2). Command (enter m for help): d # (delete old partition) selected partition 1 partition 1 deleted command (enter m for help): n # (create new partition) Partition type: P primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): P partition number (1-4, default 1): start sector (2048-15126527) Default is 2048): the default 2048Last sector will be used, + sector or + size {K MiB G} (2048-15126527, default is 15126527): + 200m # (set partition size) partition 1 has been set to Linux type, size set to 200m command (enter m for help): nPartition type: P primary (1 primary, 0 extended, 3 free) e extendedSelect (default p): P partition number (2-4, default 2): starting sector (411648-15126527) Default is 411648): the default 411648Last sector will be used, + sector or + size {K _ MagneM _ G} (411648-15126527, default is 15126527): use the default value 15126527 partition 2 has been set to Linux type, size is set to 7 GiB# (no value is entered, all capacity is divided into one zone by default) command (enter m for help): P # (View partition) disk / dev/sdd:7744 MB, 7744782336 bytes 15126528 sector Units = sector of 1 * 512 = 512 bytes sector size (logical / physical): 512byte / 512byte I size (min / best): 512byte / 512byte disk label type: dos disk identifier: 0xcc035aee device Boot Start End Blocks Id System/dev/sdd1 2048 411647 204800 83 Linux/dev/sdd2 411648 15126527 7357440 83 Linux command (enter m for help): W # (synchronous partition) The partition table has been altered calling ioctl () to re-read partition table. Synchronizing disks.

Step 2: format the partition to vfat32 ext4 format

[root@localhost media] # mkfs.vfat / dev/sdd1 # (format the created sdd1 into a Vfat32 file system) mkfs.fat 3.0.20 (12 Jun 2013) [root@localhost media] # mkfs.ext4 / dev/sdd2 # (format sdd2 as an ext4 file system) mke2fs 1.42.9 (28-Dec-2013) File system tag = OS type: Linux Block size = 4096 (log=2) Block size = 4096 (log=2) Stride=0 blocks, Stripe width=0 blocks460560 inodes 1839360 blocks91968 blocks (5.00%) reserved for the super user first data block = 0Maximum filesystem blocks=188533964857 block groups32768 blocks per group, 32768 fragments per group8080 inodes per groupSuperblock backups stored on blocks: 32768,98304,163840,229376,294912,819200,884736, 1605632Allocating group tables: finish writing inode table: finish Creating journal (32768 blocks): complete Writing superblocks and filesystem accounting information: complete

Step 3: Mount the partition and extract the system files to the TF card

[root@localhost media] # mount / dev/sdd2 cdrom # (Mount sdd2 partition to cdrom) [root@localhost media] # cd cdrom # (enter cdrom) [root@localhost cdrom] # tar Jxvf.. / cdrom1/CentOS-7.7.1908.tar.xz # (decompress the image package). / bin./var/tmp/systemd-private-f0a23baa295e4963af90040d13b0cb4c-chronyd.service- 8WAqFb/tmp/

Step 4: uninstall the partition, complete

[root@localhost media] # umount cdrom (uninstall cdrom) is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report