как увидеть в терминале, запускаю ли я ubuntu с внешнего USB-жесткого диска?

Я клонировал свой Ubuntu 20.04LTS на внешний жесткий диск USB (sdb1). Как я могу увидеть в терминале, что я использую внешнюю usb hdd OS? Спасибо

задан 14 August 2020 в 09:26

2 ответа

Вы можете проверить df корневого каталога вашего каталога:

$ df --output=source /

Или использовать mount :

$ mount | awk '$3=="/"'
/dev/sdb1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)

Если вы не знаете, что ваш USB диск - / dev / sdb1 , проверьте вывод lsblk , например:

ответ дан 21 August 2020 в 07:59

Never boot a computer with cloned copies of operating systems connected

When you have drives with cloned systems (systems with identical partition table and file systems), you should never boot the computer when both drives are connected. This can cause confusion, and there is a risk, that one or both of the systems will be corrupted, because the computer might use part of both systems and write things that makes them fail, when only one of the drives is connected.

This problem affects operating systems using more than one partition (separate partitions for EFI, boot, root, home etc or in a persistent live drive 'cdrom' and partition for persistence). If there is only a root partition, only one partition is selected, and there cannot be any mixture of partitions between the cloned copies.

How to identify which partitions are active in the running operating system

You can use the methods described in the answer by pLumo to identify the drives and in particular, the root file system, /

I often use the following command line in a wide terminal window (wide to avoid line breaks),

lsblk -fm

but it is a good idea to select the options for lsblk in a more detailed way. I suggest the following command

lsblk -o name,size,fstype,label,mountpoint,model

or, if you wish, make an alias for it (convenient if you intend to use it several times), for example

alias mycheck='lsblk -o name,size,fstype,label,mountpoint,model'

and if you wish, edit that line into your ~/.bashrc (bash configuration file). You can put the line near the other aliases in that file. Then it will activate the alias when you start new terminal windows (and bash shells in text screens),

ответ дан 21 August 2020 в 07:59

Другие вопросы по тегам:

Похожие вопросы: