Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I see the contents of a drive in Debian command line?

Posted on 2013-12-18
11
Medium Priority
?
389 Views
Last Modified: 2013-12-18
I want to see what is on a drive so I can satisfy myself that it can be disconnected (unmounted?).
This is a vm on ESXi with 3 datastores - first is the ESXi local storage, second is a nfs share on a NAS drive (that I want to remove), third is another nfs share on a 2nd NAS drive.
I have found that the Debian vm will run fine with the 1st NAS drive disconnected from the network, but will not reboot in that state.
I assume I need to unmount the drive concerned then remove datastore2 from the ESXi server. However I don't want to do this to find I have to retrace my steps. I expect to find that datastore2 contains nothing but redundant data that was copied to datastore3 when it was added, but I would like to be able to 'browse' it first.
Cheers, Gordon
0
Comment
Question by:tangerine27
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 124
ID: 39726423
You want to check the VMFS ESXi host datastore?

Select the datastore, right click and select browse?

see Step 2 in my EE Article

HOW TO: Clone or Copy a virtual machine in VMware vSphere Hypervisor ESX/ESXi 4.x or ESXi 5.0
0
 

Author Comment

by:tangerine27
ID: 39726535
No. That just shows a folder containing 2 vmdk files. I want to browse the files from within the Debian vm. I simply do not know how to do this. If it was a windows vm I would open the 'e' drive and have a look. How do i do that from the command line in Debian?
0
 
LVL 124
ID: 39726578
ls -al (list contents)

cd - (change directory)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 31

Expert Comment

by:farzanj
ID: 39726579
ls    (LS for list)
0
 
LVL 8

Expert Comment

by:Surrano
ID: 39726640
Are you referring to a virtual disk that is mounted in a Debian VM?
"mount" will tell you what volumes are mounted
"df -h" will tell you the allocation of the volumes
"ls -l /path/to/my/dir" tells you the contents of a directory (including mounts)

Are you interested in checking vmdk contents from outside the vm where it belongs to? (I assume not -- makes no sense if question is whether you can unmount)
Try VDDK: https://www.vmware.com/support/developer/vddk/
0
 

Author Comment

by:tangerine27
ID: 39726642
OK I think we are getting to the nub of the problem.

I don't know how to 'get to' the right drive so that I can run the ls -al command in the right place.

I have run df -h and can see the result is the filesystem. I can see:

Filesystem /dev/sdb1 mounted on /store
Filesystem /dev/sdc1 mounted on /store2

I want to list/browse the first one as this is the one I want to remove.
0
 
LVL 124
ID: 39726704
okay, can you change to the folder /store

using cd /store
0
 

Author Comment

by:tangerine27
ID: 39726712
Thanks. So is the folder 'store' the same as the drive '/dev/sdb1' i.e. by definition the only content of drive '/dev/sdb1' is the folder 'store' and its contents?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 39726727
Issue this command

mount


This will show you which device (dev) is mounted to with folder (mount point).


Unlike Windows, in Linux you have all the devices under the same tree / (slash).  Any device, like drive, etc. has to mount under the same /
0
 

Author Comment

by:tangerine27
ID: 39726799
I already got that information by using the command df -h and posted above.
Can someone tell me if my previous comment is correct?

So is the folder 'store' the same as the drive '/dev/sdb1' i.e. by definition the only content of drive '/dev/sdb1' is the folder 'store' and its contents?

If it is then I can simply look at the content of the folder 'store' and see the entire content of drive 'sdb1'.
0
 
LVL 124

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 2000 total points
ID: 39726810
Yes, that's correct.

'/dev/sdb1 is mounted as /store
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Ransomware is a malware that is again in the list of security  concerns. Not only for companies, but also for Government security and  even at personal use. IT departments should be aware and have the right  knowledge to how to fight it.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question