It is particularly worth mentioning that there are many things worth learning about Linux USB flash drives. Here we mainly introduce Linux U partition disks, including Linux U formatting disks. I always wanted to use a 256 MB Linux USB flash drive to create a micro-Linux system. However, I did not try it many times. Today I finally made a MB Linux system. I have encountered many problems. Now I will summarize them to facilitate further optimization.
Procedure
I. Linux USB disk partitioning
Because my Linux USB flash drive is only 256 MB, if two partitions are separated, the capacity may be insufficient. Therefore, I would like to divide the Linux USB flash drive into only one partition. Use the fdisk/dev/sdb command to divide the USB flash disk into two partitions: One Ext3 partition and one FAT16 partition, and mark the Linux partition as a bootable partition.
- Disk /dev/sdb: 262 MB, 262012928 bytes
- 1 heads, 56 sectors/track, 9138 cylinders
- Units = cylinders of 56 * 512 = 28672 bytes
- Disk identifier: 0x00000000
- Device Boot Start End Blocks Id System
- /dev/sdb1 2 200 5572 6 FAT16
- /dev/sdb2 * 201 9138 250264 83 Linux
Note: It seems that the Linux USB flash drive is not stable to separate an ext3 partition? I often go back to FAT16 for no reason.
Ii. Linux USB flash disk formatting
It is worth noting that you must uninstall the Linux USB flash drive before formatting.
Sudo mkfs. vfat/dev/sdb1
Sudo mke2fs-j-m0-l san/dev/sdb2
Sudo tune2fs-c-0-I 0/dev/sdb2
3. Create initRD
The prompt "-- preload = ehci-hcd" is not found during production. I am not sure if there is a problem with this writing method, or should it be "-- preload = ehci_hcd "? Sudo mkinitrd -- preload = ehci-hcd -- preload = usb-storage -- preload = scsi_mod -- preload = sd_mod/boot/usbinitrd. img 'uname-R'
4. Create a Linux File System
Mount the Linux usb flash drive and modify the usb directory permission, create the following chmod 777-R/mnt/usb mkdir bin sbin etc dev lib sys proc usr var root home tmp mnt selinux folder under the Linux usb disk directory.
Then, copy the boot bin sbin etc lib directory in the existing ora10 file system and all the files below it to the Linux USB flash drive (my approach is to manually copy, in this way, the link can be retained. Of course, cp-arp can also be used. My Linux USB flash drive is poor and the Read-Only System problem often occurs, but mount it again!
Note:
1. Later, I tried to manually Mount the file with a text terminal!
2. There is another issue about disk check. During the creation process, the Linux USB flash drive may have an error. In this case, run the e2fsck command to check the corresponding partition, such as e2fsck/dev/sdb2.
3. When creating a file system, you must use UUID to prevent mount misplacement and damage the Linux U disk file system!
4. When the system starts, a line of Log "loading/lib/keymaps/i386/qwerty/us. map" is displayed. This shows that the system dynamic link library file under lib is quite critical!
The following table lists the two-layer directory structure of the file system. Some of the folders are empty. However, after the system starts up, it will create corresponding files, such as/proc, in the directory. It is worth mentioning that my Fedora10 only has a text interface but no graphical interface. Therefore, the file system will be smaller. We recommend that you use a file system without a graphical interface if you want to create a Linux U disk boot disk. This saves a lot of space.
When creating a file system, pay special attention to the configuration of the/etc/fstab file as follows:
Note: For UUID usage issues, see UUID.
- #/dev/sdb1 / ext3 defaults 1 1
- UUID=bbcbb70a-3da2-47cc-becd-5f3e3a162803 / ext3 defaults 1 1
- tmpfs /dev/shm tmpfs defaults 0 0
- devpts /dev/pts devpts gid=5,mode=620 0 0
- none /proc proc defaults 0 0
- [san@localhost san_fs]$ tree -d -L 2
- |-- bin
- |-- boot
- | |-- efi
- | |-- grub
- | `-- upgrade
- |-- dev
- |-- etc
- | |-- NetworkManager
- | |-- X11
- | |-- alternatives
- | |-- avahi
- | |-- blkid
- | |-- chkconfig.d
- | |-- cron.daily
- | |-- dbus-1
- | |-- default
- | |-- depmod.d
- | |-- dirmngr
- | |-- event.d
- | |-- fonts
- | |-- gcrypt
- | |-- gnupg
- | |-- init.d -> rc.d/init.d
- | |-- iproute2
- | |-- kernel
- | |-- ld.so.conf.d
- | |-- logrotate.d
- | |-- lvm
- | |-- makedev.d
- | |-- modprobe.d
- | |-- netplug
- | |-- netplug.d
- | |-- openldap
- | |-- opt
- | |-- pam.d
- | |-- pki
- | |-- popt.d
- | |-- ppp
- | |-- prelink.conf.d
- | |-- profile.d
- | |-- rc.d
- | |-- rc0.d -> rc.d/rc0.d
- | |-- rc1.d -> rc.d/rc1.d
- | |-- rc2.d -> rc.d/rc2.d
- | |-- rc3.d -> rc.d/rc3.d
- | |-- rc4.d -> rc.d/rc4.d
- | |-- rc5.d -> rc.d/rc5.d
- | |-- rc6.d -> rc.d/rc6.d
- | |-- rpm
- | |-- rwtab.d
- | |-- sasl2
- | |-- security
- | |-- selinux
- | |-- skel
- | |-- statetab.d
- | |-- sysconfig
- | |-- terminfo
- | |-- udev
- | |-- xdg
- | |-- xinetd.d
- | |-- yum
- | `-- yum.repos.d
- |-- home
- |-- lib
- | |-- bdevid
- | |-- dbus-1
- | |-- firmware
- | |-- i686
- | |-- kbd
- | |-- modules
- | |-- rtkaio
- | |-- security
- | |-- terminfo
- | |-- tls
- | |-- udev
- | `-- xtables
- |-- mnt
- |-- proc
- |-- root
- |-- sbin
- |-- selinux
- |-- sys
- |-- tmp
- |-- usr
- `-- var
(Lib lock run log and other directories need to be created under this directory, which can be determined according to the prompt after the system is up) 85 directories
- Execute export and use man bash in Linux shell System
- Start the installation and configuration of Linux Samba server to build
- Install and create an account file in Linux Trac
- Install and modify the root password service in Linux mysql
- Linux vsftpd installation and startup, and logon under the command line, view Chinese file garbled