Access files in Home directory from live mode

5,631

First, you mount partitions, not folders. If your home folder is on a system partition, you will need to access that system partition in order to access the home folder.

If the volumes are not displayed in the file manager, ready for you to click and have them mounted, then you will need to mount using the terminal. A lot of text follows for something that essentially is very simple. I however also want you to gain some understanding on how it works.

1 Identify your partition

List the partitions with the command sudo blkid. (also sudo fdisk -l can be used). You may see /dev/loop partitions. Ignore these. You are looking for partitions on disks. This will typically start with /dev/sd.. or /dev/nvme.... You will also recognize disk partitions because other information, such as the UUID, the LABEL, the file system (TYPE) etc is provided.

That is all the information you have got. You will need to recognize the partition you need. One important hint is that the partition containing your home folder will most likely be formatted in ext file system format, so you can eliminate any partitions that do not have TYPE="ext4".

Example

$ sudo blkid
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/nvme0n1p1: UUID="CD64-FBDE" TYPE="vfat" PARTUUID="0fjkf6a9-66c8-2d08-be7e-75c8f23d5411"
/dev/nvme0n1p2: UUID="a370dd86-3284-41a6-32f6-a7343cc43886" TYPE="ext4" PARTUUID="2e4d8754-5ceb-401a-ad7d-0349abb54725"
/dev/nvme0n1p3: UUID="ee3a9083-a324-4396-b432-8542f46e85c2" TYPE="ext4" PARTUUID="d59af1dd-fafb-521b-2c33-9563633a8163"
/dev/nvme0n1: PTUUID="7bad0580-36c7-4458-84a2-d54a2f3aadde" PTTYPE="gpt"

I have two partitions formatted as ext4. One will be my home, the other my separate home partition. At least, you will find one if you have a single system partition containing your system and your data. The partition is referred to by the /dev/... entry, but actually is more commonly referred to by its UUID.

2 Mount the partition

Use the mount command, which takes two arguments: the partition identifier (/dev/...) and a folder in the system where you will mount the partition: the mount point. You then be able to access the partition from the mount point.

The folder must exist. Typically, a folder /mnt will exist in a linux system by default. If not, create it first:

sudo mkdir /mnt

Mount a partition with a command such as:

sudo mount /dev/nvme0n1p3

Of course, substitute /dev/nvme0n1p3 by the device names of your system. Now, you will find the contents of the partition under /mnt ("Other Locations, Computer, mnt" in the default Ubuntu file manager).

IF you have multiple partitions, and the one you mounted is not the one you were looking for, then simply unmount it and mount another. Unmounting is done with the umount command. The single argument you need to provide can be the partition, or it can be the folder where the mount has happened:

sudo umount /mnt

Thus, if needed, unmount and explore further. You cannot do harm with these commands.

You are not restricted to mount on /mnt. You can mount on any existing folder in your system.

Share:
5,631

Related videos on Youtube

RishiC
Author by

RishiC

Updated on September 18, 2022

Comments

  • RishiC
    RishiC over 1 year

    I have Ubuntu 18.04 installed on my computer. Recently it stopped booting into GUI mode due to low disk space on the HOME directory. For some reason I'm unable to boot it into terminal mode either. The next solution I am trying is to use a Live CD and then delete some files from the HOME folder to free up some space so it can boot into GUI mode again .

    How do I access the files in the HOME folder of the Ubuntu which is installed on my comp via the Live Mode ?

  • nobody
    nobody almost 5 years
    And you need extended rights, because the user in live-session is not the same as in your installed system.
  • vanadium
    vanadium almost 5 years
    @nobody That is why you use the "sudo" command. In fact, the live session may not even prompt you for a password, and if a password is asked, just press <enter>.
  • nobody
    nobody almost 5 years
    I meant when data should erase or remove from $HOME