M BUZZ CRAZE NEWS
// news

How to list the files and folders inside a partition

By John Parsons

I made a backup of my home directory to a new partition that i created /sdb1. Now I want to check if the files and folders of my home directory are actually copied in the partition. I noticed that I can not cd in the partition and ls its contents. How can I do something like that?

sudo mount -t ext4 /dev/sdb1 /mnt
sudo dump -0 -f /dev/sdb1 ~
ls /dev/sdb1

Another thing that happens here is that sdb1 after executing dump appears to be unformated.

6

2 Answers

After you mounted /dev/sdb1 on /mnt, you must check the existence of the file inside /mnt

ls /mnt

Here's what I understand. Please correct me if I'm mistaken.

  • Most programs operate at the filesystem level, where data structures are files and metadata
  • dump, like dd, operates at the device level, where there are no data structures, just binary.
  • /dev/sdb1 is a device, not a directory, so you need to mount it to make it accessible for programs that operate at the filesystem level.

So, to do what you want, you need to operate on the mountpoint, not the device:

sudo mount /dev/sdb1 /mnt # Mount the device to the mountpoint.
cd /mnt # Now you can cd, use ls, or read the files

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy