0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

私でもできる!chroot

0
Posted at

ここで言う「私でもできる!」は筆者でもできるという意味であり、これを読んだ全ての人ができるという意味ではないので注意

SSDの中のOSに保存されているOSに入って作業する

今回も短めです。

chrootのメモ
lsblkで特定する

ubuntu@ubuntu:~$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda                         8:0    0 59.6G  0 disk 
├─sda1                      8:1    0    1G  0 part 
├─sda2                      8:2    0  954M  0 part 
├─sda3                      8:3    0  9.3G  0 part 
└─sda4                      8:4    0 27.9G  0 part 
vda                       253:0    0   10G  0 disk 
├─vda1                    253:1    0  538M  0 part /boot/efi
├─vda2                    253:2    0  1.8G  0 part /boot
└─vda3                    253:3    0  7.7G  0 part 
  └─ubuntu--vg-ubuntu--lv 252:0    0  7.7G  0 lvm  /

今回は/dev/sda4/dev/sda2がターゲットなので

sudo mount /dev/sda4 /mnt
sudo mount /dev/sda2 /mnt/boot/efi/
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
> 中に入っての作業
> exitで終わる
sudo umount /mnt/dev /mnt/proc /mnt/sys
sudo umount /mnt/boot/efi 
sudo umount /mnt/
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?