このページは大阪弁化フィルタによって翻訳生成されたんですわ。

翻訳前ページへ


Installing to a USB Flash Drive cn - DSL Wiki

Installing to a USB Flash Drive cn

From DSL Wiki

   This page in other languages: English (英文), Espa?ol

Contents

准?

?防止数据?失,事先将U?上的所有数据保存在?外的存?介?上,如CD/DVD 或硬?。

U?容量需求

USB?容量至少需要 128M,如果>=512M ?更好。

在DSL内安装

从本?最初完成到?在情况已?有了一些改?。从那?起,将DSL安装在USB Flash?上的??方法是通?DSL LiveCD的主菜?。打?主菜?--Apps--Tools,??USBZIP或USBHDD,然后依照提示?行。 ?看【USB Booting】??得更多信息。

在Linux内安装

  • ?定Flash?的位置。 一般? /dev/sda
   fdisk -l
  • ??Syslinux的版本,如果要支持FAT32?升?。 (Syslinux 2.11 支持 FAT16; Syslinux 3.35 支持FAT32) ??安装最新的syslinux,从http://www.kernel.org/pub/linux/utils/boot/syslinux/ 可以得到。
  • 使用下面的命令可以清除Flash?上的MBR. 但?并非必需,除非当前MBR不是太好 (比如,?正在???外一个可由USB??的linux?行版).

要 *特?* 小心不要??的硬??行MBR的操作. 将命令行中的sdX?成是Flash?的位置

   dd if=/dev/zero of=/dev/sdX bs=512 count=1


然后安装 http://ms-sys.sourceforge.net/ 并将?外一个MBR写入Flash?。

   ms-sys -s /dev/sdX

或者, 也可以将Syslinux包中的mbr.bin文件写入MBR,?个文件的大小??小于MBR的512字?:

   locate mbr.bin
   cat /somepath/share/syslinux/mbr.bin > /dev/sdX
  • 在 /dev/sdX 上?行fdisk, ?果??如下:
    Device Boot      Start         End      Blocks   Id  System
 /dev/sdX1   *           1        1021      253177    b  W95 FAT32

用命令d?除已有分区,?留下一个. 用命令 n,p,1 ?建一个新的主分区(primary partition). 用命令 a ?它可??. 用命令 t,b ?建 W95 FAT32 格式. 用心,不要忘?用命令 a 使分区?机?能???。

命令 w 将保存fdisk?置并退出.

  • 下?dsl-embedded zip文件
  • 在Flash?上?建 FAT16 或 FAT32 格式的分区: (??"-F 32" ??FAT32; "-F 16" ??FAT16)
 mkfs.vfat -F 32 /dev/sdX1
  • 挂?Flash?,并且将dsl-embedded.zip解??到Flash?上.
  • ??Flash?.
  • 接下来,用syslinux?它可??.
 syslinux -s /dev/sdX1
  • ?在?可以通?QEMU??了(Linux或Windows), 或者直接从Flash???.
  • ?也可以通?Flash上已?安装的GRUB??DSL. 如果?将DSL作?数据或系?救急工具,??方式会非常有用. 和其它方式一?,?可以将DSL系?的配置保存下来.

用心: syslinux需要mtools?件包中的mcopy.

用心: ?憾的是,??方式50MB可能不太?用,因?qemu目?相?要大一些. ?可能最?需要110M的空?来安装?个?行版.

用心: 挂?U??的??iocharset=utf8可能会?致文件"KNOPPIX/KNOPPIX"在???找不到.

??1:使用GRUB作???加?器

用心: ?用?反?,?个方法在某些情况下可能会无法性交...ひひひ,ウソや,成功.

  • 下?最新dsl-cd的iso?像.
  • 在??上?建ext2分区(=> 51MB),并挂?.
   mke2fs -v -L "DSL" /dev/<device>
   mkdir -p /tmp/pendrive
   mount /dev/<device> /tmp/pendrive/

其中<device>指表示?的USB存?分区的??的??文件.

用心: ext3文件系?格式也是可以的.

  • ?入挂?ext2分区的目?, 安装GRUB:
   cd /tmp/pendrive/
   grub-install  --no-floppy  --root-directory=.   /dev/<device>  

用心: 将<device>替?成相?分区的??文件(如/dev/sdc1).

用心2: ?个方法我没有性交...ひひひ,ウソや,成功, 我使用了手册上的方法,即?行GRUB 然后?入"root (hd1,1)" 和"setup (hd1)" (?的目?很可能会?化).

  • 将CD?像内容拷?到u?上.
   mkdir /tmp/dsl-cd
   mount [/path_to/]current.iso /tmp/dsl-cd/ -o loop
   cp -vR /tmp/dsl-cd/* /tmp/pendrive/
  • 在?挂?ext2文件系?的那个目?,?grub?建一个menu.lst文件./boot/grub/menu.lst
  cat > /tmp/pendrive/boot/grub/menu.lst << EOF
  title           Damn Small Linux
  root            (hd0,0)
  kernel          /boot/isolinux/linux24 root=/dev/sda1 ro lang=us toram noeject frugal
  initrd          /boot/isolinux/minirt24.gz
  boot
  EOF

用心: ?可能不得不将(hd0,0)修改成?U?的位置. 当然,默?情况下,大部分系?是支持?个配置的.

  • ??文件系?.
  • ?在?可以从U???了.

??2:使用GRUB作???加?器

Someone found the above process doesn't work and has documented for others this working process


The Situation:

  • Running SLED 10 (Suse)
  • The USB key is a 1GB and appears as /dev/sda
  • Logged in as root
  • The DSL ISO is downloaded to /root/Desktop/dsl-3.3.iso
  • Two partitions, the first to use as general USB storage, the second for DSL
  • The DSL partition wanted to be ext3 so that Windows doesn't mess it up
  • The first partition needs to be the big storage one as Windows doesn't like addressing the second partition on flash drives


The procedure:

  • fdisk /dev/sda
    • d - Delete all partitions on the key
    • n - Make a partition
      • p - Primary partition for general storage
      • 1 - First partition
      • 1 - From the first block
      • 948 - Most of the space, about 933MB
    • n - Make a partition
      • p - Primary partition for DSL
      • 2 - Second partition
      • 949 - Start from the next available sector
      • 1012 - To the end of the disk. I give it 64MB
    • a - Make the partition bootable
      • 2 - Mark the DSL partition bootable
    • t - Change the partition type
      • 1 - Change partition 1
      • b - Change it to Win95 FAT32
    • w - Write the changes
  • fdisk -l - Gives the following output:
        Device    Boot      Start         End      Blocks   Id  System
	/dev/sda1               1         948      954131+   b  W95 FAT32
	/dev/sda2   *         949        1012       64416   83  Linux

Your flash drive should now look like this

  • mkdir /mnt/iso
  • mkdir /mnt/usb
  • mount -o loop /root/Desktop/dsl-3.3.iso /mnt/iso
  • mke2fs /dev/sda2

Note: If you want to have an ext3 filesystem, add the -j flag: mke2fs -j /dev/sda2

  • mount /dev/sda2 /mnt/usb/
  • cd /mnt/iso
  • tar cvf - . | (cd /mnt/usb; tar xvf - )
  • mkdir /mnt/usb/boot/grub
  • cp /boot/grub/*stage* /mnt/usb/boot/grub/
  • cat > /mnt/usb/boot/grub/menu.lst << EOF
   title Damn Small Linux
   root (hd0,1)
   kernel /boot/isolinux/linux24 root=/dev/sda2 ro lang=us toram noeject frugal
   initrd /boot/isolinux/minirt24.gz
   boot
   EOF
  • cd /mnt/usb/
  • grub-install --no-floppy --root-directory=. /dev/sda
  • cd /root
  • umount /mnt/usb
  • umount /mnt/iso
  • rm -r /mnt/iso
  • rm -r /mnt/usb

在Windows内安装

用心:安装指南中假定?的U??符?“F:”,?替?“F”??自己的U??符。

用??方法。无???方法,?都需要:

  • 一个USB ?存??器(也叫?存?,????(pendrive), USB ??棒……)
  • [1] - 下?“dsl-embedded.zip”文件(大小?49M,建?从Torrent下?,通常速度更快)

方法I

  1. 从cmd.exe(DOS窗口)内格式化?存?,命令:
FORMAT F: /fs:FAT32
  1. 展?“dsl-embedded.zip”到?存?(?可以使用XP内置的“展?所有文件”到目??,如“F:\”)
  2. 下?Syslinux - Syslinux,?程序也可以用于其它平台,如Unix。
  3. 在命令行提示符下?行win32版本的syslinux.exe:

SYSLINUX -ma F:

  1. 如果?行在Windows Vista平台,?得以管理??限??cmd.exe,否?在cmd.exe下不能存取U?的MBR(主引?根目?)。
  2. 重?机器。


用心: ?于太老旧的或者BIOS?置不?的?算机,可能从USB引?功能无法??。一些系?可能无法从格式化?FAT32格式的U?引?。改?U?格式化的格式,命令是:

FORMAT F: /fs:FAT


(**) 反?:按照上述方法,有人无法从U?引??算机YMMV。能?引?:

  • (2007/9/27 Hp T5515 thinclient,没有??,一般的(Generic)512M U?, fat32, 嵌入版本DSL 3.4.3)
  • (2007/10/16 ?装的双core PC机,没有??。Adata JOGr 2G U?,FAT32,嵌入版本DSL 3.4.4)
  • (2007/11/25 Asus EEEpc(??EEEpc), 没有??。一般的(Generic)128M U?,FAT32,嵌入版本DSL 4.0)
  • (2007/12/12 Memorex Travel U?, 没有??。 1GB U?,FAT32)

方法 II

用心:HP USB Key Utility 在Vista 下不能?行。

http://www.althack.com/2006/03/10/how-to-run-linux-on-a-usb-drive/有?文版。

http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&mode=3&taskId=135&swItem=MTX-UNITY-I23839下?“HP USB Key Utility for Windows”。

  1. 安装“HP USB Key Utility for Windows”
  2. 插入U?,windows自??找,?下U?所占用的?符,如F:。
  3. ?行?始->程序-> HP System Tools -> HP Drive Key Boot Utility
    1. 在?迎屏上,??下一?
    2. ??U?あるとこ?符,??下一?
    3. ???建新?或者替?已有配置,??下一?
    4. ??硬?,??下一?
    5. ???建新的文件系?,??下一?
    6. 等待完成U?格式化……
    7. ??“HP Firmware Flash Package”,??下一?,??完成。
  4. ?在展?dsl-embedded.zip文件内容到U?,如果有替?文件的提示,??“替?所有文件”(切?!!)
  5. 完成!DamnSmallLinux U?准?好了 :-) 重??算机,??看DSL?!!

用心: ?我而言,DSL v3.3 + Sandisk Cruizer Titanium U?无法工作。

方法 III

?自Linxusir.org/bbs:无需光? ?行DSL LINUX的最??方法 (?用于WINDOWS用?,非虚?机)

  1. 下?DSL的ISO,和?????像文件IMG.
  2. 下?虚???,VFLOPPY.
  3. 用VFLOPPY虚?DSL的???像。
  4. 用WINRAR解?DSL的ISO文件,得到knoppix文件?,将?个文件?拷?到?硬?的第一个FAT分区。(ntfs无效)
  5. 重?,在???中??虚?????。OK.

用心:??方法可以以只?的方式??KNOPPIX文件?あるとこ的FAT分区。

?? .iso 到 U?的安装

With the guide from [2] you can install the .iso contents non-destructively onto a USB partition. Leave out all the partitioning or formating stuff to prepare an existing and used USB drive for DSL booting:

Note: All path names are examples! Please adapt or you may corrupt existing partitions or files.

  • Mount USB drive, with e.g. mount /dev/sdx1 /flash - can be either FAT16 or FAT32!
  • Mount ISO image, with e.g. mount /tmp/dsl-3.2.iso /tmp/iso -o loop
  • Copy all contents from ISO to USB drive: cp -vr /tmp/iso/* /flash/
  • Rename and move syslinux files to root directory: mv /flash/boot/isolinux/* /flash/
  • Rename isolinux.cfg: mv /flash/isolinux.cfg /flash/syslinux.cfg
  • Unmount USB drive: umount /flash
  • Install syslinux: syslinux /dev/sdx1 and eventually set the MBR boot flag for this partition (with fdisk).

?与答

  • Why does DSL installed on USB disk won't finish booting after conversion from .iso?
    • It appears that KNOPPIX file is hard-wired to seek for CD-ROM and not USB drive. Use embedded version.
  • Why does the from-within-Linux method require FAT16, but the Windows method work with FAT32? Could I just leave and reuse an existing FAT32 USB partition using the Linux syslinux version?
    • Either method should work however, as per previous notes, using FAT might provide better results than FAT32.
    • Syslinux is the key reason for FAT16 vs. FAT32... CentOS 4.4 (which is essentially Red Hat ES4) comes with syslinux 2.11 which does not support FAT32. Syslinux 3.35 (the latest, as of this writing) works with FAT32 just fine.
  • Why my keyboard and usb mouse do not work when I entered X windows?
    • Try to enable 'usb device emulation legacy' entry in your bios setup.

? 3.2 嵌入版本的修改

After installation I added autorun.inf penguin.ico /USB /tightvnc

Trying to run the dsl-linux.sh in my distro did not work I had to modify the file (it was setup for a second drive and qemu did not exist in the download)

Here are some configuration settings that I found I had to modify after the installation. I also created an autorun.inf that works flawlessly with this. The autorun.inf file is also configured for use of TightVNC if the folder tightvnc is created at the root of the drive. I also created a context link to the folder USB.

  • autorun.inf
  [autorun]
  icon=penguin.ico
  label=Damn Small Linux
  open=dsl-base.bat
  action=Run Damn Small Linux in qemu
  shell\vncviewer\command=tightvnc\vncviewer.exe
  shell\vncviewer=Run the VNC Viewer Application
  shell\tightvnc\command=tightvnc\tightvnc-1.2.9-setup.exe
  shell\tightvnc=Run the TightVNC Server Installation
  shell\usbfolder\command="explorer.exe USB\"
  shell\usbfolder=Open the USB folder in Windows Explorer


This next file I modified and paired up with the windows equivalent so you do not have to answer the questions every boot. Some people might find the -m 256 beyond and should change as needed.

  • dsl-linux.sh
   qemu/qemu -L qemu/ -no-kqemu -soundhw sb16 -m 256 -localtime \
      -kernel linux24 -initrd minirt24.gz -hda KNOPPIX/KNOPPIX \
      -append "qemu vga=791 quiet noscsi nousb nofirewire atapicd noideraid \
       noacpi acpi=off noapm noagp ide1=noprobe ide2=noprobe nomce frugal"


You must also download qemu and copy these files to the qemu dir on the usb drive.

  • qemu
  • qemu-img
  • qemu-i386

If you wish to use the rest of the context menu I've created, download the TightVNC installer, vncviewer and put them in a \tightvnc.

At this point I made all of the damn small linux files hidden and hid the TightVNC, USB folders. Its a low level of security but works nicely. To use anything you just right click the drive in My Computer.