実行中のシステムの永続USBキーをどのように生成しますか?

実行中のシステムの永続USBキーをどのように生成しますか?

シャットダウンせずにコンピュータで実行されているシステムの持続的で起動可能なUSBを作成する方法。

キーはコンピュータ上のキーと同じで、他のハードウェアと同様に使用してインストールする方法を提供します。

。 root権限に問題はありません

UnixとLinuxのチャットルームで引用

単純化のためにアクティブなバックアップを作成したいと思います...たとえば、コンピュータで実行して残す必要があります...ロードコマンドのキーを挿入してから別の場所にキーを挿入すると、すべてが保持されます。自宅のように動作するので、単純なバックアップやライブUSBではなく、システムの永久保存が可能です。

ベストアンサー1

私はddが続行する良い方法だと思います。

また、このソリューションは/dev/sd*が1つしかない場合にのみすぐに機能します。

たとえば、USBを除くすべての/ dev / sd *を一覧表示し、USBドライブに必要な数のパーティションを作成し(fdisk -n)、各/ dev / sd *の数にddを使用することをお勧めします。

リンクから:

insert the destination USB flash drive in my workstation
delete the existing vfat partition and create a single linux partition using fdisk
create a filesystem and synchronize it:

bash# mkfs.ext3 /dev/sdb1
bash# sync ; sync

remove the usb flash drive from the workstation, put it in the target PC
mount the usb drive, move the udev filesystem out of the way, and copy the local filesystem:

bash# cd /
bash# mkdir /mnt/sda1
bash# mount /dev/sda1 /mnt/sda1
bash# mkdir udev
bash# mount --move /dev /udev
bash# cp -ax / /mnt/sda1

That copy command might take awhile. When it is done, get rid of the temporary directory /udev

bash# mount --move /udev /dev
bash# rm -fr /udev

次に、USBドライブを起動可能にします。それでも/mnt/sda1にインストールされている必要があります。まず、/mnt/sda1/boot/grub/device.mapファイルでhd(0)を/dev/sdaに設定し、/mnt/sda1/boot/grub/menu.lstで各ブートに対して正しく設定します。カーネルブート設定オプションは次のとおりです。

タイトル Debian GNU/Linux, カーネル 2.6.18-6-486 ルート (hd0,0) カーネル /boot/vmlinuz-2.6.18-6-486 root=/dev/sda1 ro vga=792 initrd /boot/initrd.img -2.6.18-6-486 デフォルト値の保存

最後に、USBディスクにgrubをインストールします。

bash# grub-install --root-director=/mnt/sda1 /dev/sda

すべて完了しました!これでフラッシュドライブから再起動できます。

おすすめ記事