linux – 如何显示已挂载/启动和’/’根分区的内容?
作者:互联网
如何在Linux Live CD上显示SSD驱动器上Debian的挂载/启动和’/’根分区的内容?我知道ls -1列出目录内容,但是获得这个的确切步骤是什么?
解决方法:
安装硬盘
要安装物理连接到系统的HDD,首先需要确定已分配给它的设备句柄.我通常使用命令行工具blkid或lsblk来查找此信息.
BLKID
$sudo blkid
/dev/sda1: UUID="XXXXXX" TYPE="ext4"
/dev/sda2: UUID="XXXXXX" TYPE="LVM2_member"
/dev/mapper/fedora_greeneggs-swap: UUID="XXXXXX" TYPE="swap"
/dev/mapper/fedora_greeneggs-root: UUID="XXXXXX" TYPE="ext4"
/dev/mapper/fedora_greeneggs-home: UUID="XXXXXX" TYPE="ext4"
lsblk
$lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 465.3G 0 part
├─fedora_greeneggs-swap 253:0 0 7.7G 0 lvm [SWAP]
├─fedora_greeneggs-root 253:1 0 50G 0 lvm /
└─fedora_greeneggs-home 253:2 0 407.6G 0 lvm /home
sr0 11:0 1 1024M 0 rom
所以我们从上面可以看出,我在/ dev / sda1上有一个ext4分区,在/ dev / sda2上有一个LVM分区.由于您对/ boot设备感兴趣,因此通常将其格式化为ext4分区,因此要安装它:
$sudo mount -r /dev/sda1 /mnt
它应该可以在/ mnt下作为只读目录访问.
安装ISO
另一方面,如果您想安装ISO,则可以使用mount命令以及循环选项来安装.
$sudo mount -o loop <some.iso> <mount point>
例
$sudo mount -o loop VBoxGuestAdditions_4.3.10.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only
您现在可以看到ISO的内容:
$ls -l /mnt/
total 57016
dr-xr-xr-x. 2 root root 2048 Mar 26 14:04 32Bit
dr-xr-xr-x. 2 root root 2048 Mar 26 14:04 64Bit
-r-xr-xr-x. 1 root root 647 Oct 8 2013 AUTORUN.INF
-r-xr-xr-x. 1 root root 6966 Mar 26 13:56 autorun.sh
dr-xr-xr-x. 2 root root 2048 Mar 26 14:04 cert
dr-xr-xr-x. 2 root root 2048 Mar 26 14:04 OS2
-r-xr-xr-x. 1 root root 5523 Mar 26 13:56 runasroot.sh
-r-xr-xr-x. 1 root root 9901516 Mar 26 14:01 VBoxLinuxAdditions.run
-r-xr-xr-x. 1 root root 20784640 Mar 26 14:14 VBoxSolarisAdditions.pkg
-r-xr-xr-x. 1 root root 16900432 Mar 26 13:55 VBoxWindowsAdditions-amd64.exe
-r-xr-xr-x. 1 root root 311584 Mar 26 13:46 VBoxWindowsAdditions.exe
-r-xr-xr-x. 1 root root 10463320 Mar 26 13:47 VBoxWindowsAdditions-x86.exe
标签:linux,debian,command-line,mount,debian-installer 来源: https://codeday.me/bug/20190816/1669705.html