LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [HOW] mount a whole disk not just a partition (https://www.linuxquestions.org/questions/linux-software-2/%5Bhow%5D-mount-a-whole-disk-not-just-a-partition-686215/)

duyuyang 11-26-2008 01:03 AM

[HOW] mount a whole disk not just a partition
 
I want to mount a whole disk, for the disk is a virtual machine's disk image, I cannot see its partitions.

Does mount or any others have this feature?

mount /dev/sdb10 mnt -t ntfs
NTFS signature is missing.
Failed to mount '/dev/sdb10': Invalid argument
The device '/dev/sdb10' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

Thanks in advance,
Shawn

Junior Hacker 11-26-2008 02:41 AM

If you have a bit for bit image such as what dd would make, and you want to see and mount a specific partition where there is more than one. You would make a mount directory, run a fdisk command to see where the starting offset of each partition is at, then mount the partition you want using an offset value. The example below is for mounting the first partition which starts at offset 63:
Code:

STEPS FOR MOUNTING PARTITION OF IMAGE.DD FILE FROM IN SAME DIRECTORY AS ROOT OR SUDO:

1: mkdir /mnt/image
2: sfdisk -l -uS image.dd
3: mount -oloop,offset=32256 image.dd /mnt/image

OFFSET = Sectors offset of beginning sector of partition multiplied by 512, in this case the first partition starts at offset 63.

The example above was on an NTFS partition, no need to specify file system type

Junior Hacker 11-26-2008 02:49 AM

You can repeat for every partition, make a separate mount directory for each partition.
To mount hfs or hfsplus, modprobe them first before mounting. Have hfsplus,
hfsutils, hfsutils-tcltk installed.
I don't recall ever mounting an entire disk, I can't see it being done either.

duyuyang 11-26-2008 09:43 PM

Thank you very much. Mount works like a charm

A little problem: after I mount there is a warning message
Quote:

WARNING: Deficient Linux kernel detected. Some driver features are
not available (swap file on NTFS, boot from NTFS by LILO), and
unmount is not safe unless it's made sure the ntfs-3g process
naturally terminates after calling 'umount'. If you wish this
message to disappear then you should upgrade to at least kernel
version 2.6.20, or request help from your distribution to fix
the kernel problem. The below web page has more information:
http://ntfs-3g.org/support.html#fuse26
Does it mean I should use kernel version no less than 2.6.20? Currently the version is 2.6.18.8.

Junior Hacker 11-26-2008 10:28 PM

Kernels below 2.6.20 produced that error, some little issue with fuse that came with your kernel. It is used in conjunction with ntfs-3g which gives users read/write access to NTFS file systems.
Most images are read only anyway so it can be ignored.
If you have ntfs-3g installed and do write to NTFS file systems you can still ignore the warning as the issue that brought about this warning is relatively rare.
You can eliminate this warning by either updating the kernel to something 2.6.20 and up or by installing fuse from source and removing the fuse module that came with the kernel you presently have.

duyuyang 11-27-2008 01:30 AM

Thank you, Junior Hacker.
I have got the fuse source and re-made it. The warning disappeared.

Best regards,
Shawn


All times are GMT -5. The time now is 02:36 AM.