Link to home
Start Free TrialLog in
Avatar of tangerine27
tangerine27

asked on

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

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
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of tangerine27
tangerine27

ASKER

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?
ls -al (list contents)

cd - (change directory)
ls    (LS for list)
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/
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.
okay, can you change to the folder /store

using cd /store
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?
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 /
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'.
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial