Nabeel Saad
2007-Nov-15 15:22 UTC
[zfs-discuss] cannot mount ''mypool'': Input/output error
Hello,
I have a question about using ZFS with Fuse. A little bit of background of what
we''ve been doing first... We recently had an issue with a Solaris
server where the permissions of the main system files in /etc and such were
changed. On server restart, Solaris threw an error and it was not possible to
log in, even as root.
So, given that it''s the only Solaris machine we have, we took out the
drive and after much trouble trying with different machines, we connected it to
Linux 2005 Limited Edition server using a USB to SATA connector. The linux
machine now sees the device in /dev/sda* and I can confirm this by doing the
following:
[root]# fdisk sda
Command (m for help): p
Disk sda (Sun disk label): 16 heads, 149 sectors, 65533 cylinders
Units = cylinders of 2384 * 512 bytes
Device Flag Start End Blocks Id System
sda1 1719 11169 11264400 2 SunOS root
sda2 u 0 1719 2049048 3 SunOS swap
sda3 0 65533 78115336 5 Whole disk
sda5 16324 65533 58657128 8 SunOS home
sda6 11169 16324 6144760 7 SunOS var
Given that Solaris uses ZFS, we figured to be able to change the permissions,
we''ll need to be able to mount the device. So, we found Fuse,
downloaded, installed it along with ZFS. Everything went as expected until the
creation of the pool for some reason. We''re interested in either sda1,
sda3 or sda5, we''ll know better once we can mount them...
So, we do ./run.sh & and then the zpool and zfs commands are available. My
ZFS questions come here, once we run the create command, I get the error
directly:
[root]# zpool create mypool sda
fuse: mount failed: Invalid argument
cannot mount ''mypool'': Input/output error
However, if I list the pools, clearly it''s been created:
[root]# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
mypool 74.5G 88K 74.5G 0% ONLINE -
It seems the issue is with the mounting, and I can''t understand why:
[root]# zfs mount mypool
fuse: mount failed: Invalid argument
cannot mount ''mypool'': Input/output error
[root]# zfs mount
I had searched through the source code trying to figure out what argument was
considered invalid and found the following:
477 if (res == -1) {
478 /*
479 * Maybe kernel doesn''t support unprivileged mounts, in
this
480 * case try falling back to fusermount
481 */
482 if (errno == EPERM) {
483 res = -2;
484 } else {
485 int errno_save = errno;
486 if (mo->blkdev && errno == ENODEV &&
!fuse_mnt_check_fuseblk())
487 fprintf(stderr, "fuse: ''fuseblk''
support missing\n");
488 else
489 fprintf(stderr, "fuse: mount failed: %s\n",
490 strerror(errno_save));
491 }
492
493 goto out_close;
494 }
in the following file:
http://cvs.opensolaris.org/source/xref/fuse/libfuse/mount.c
I didn''t really understand what that was suggesting the issue was,
other than the comment saying "unprivileged mounts"... I looked on
http://docs.sun.com/app/docs/doc/819-2240/zfs-1m and found a command:
zfs allow [-ldug] "everyone" |user |group [,,....]
-[uge] "everyone" |user |group [,,....]
Specifies to whom the permissions are delegated. Multiple entities can be
specified as a comma-separated list. If none of the -uge options are specified,
then the argument is interpreted preferentially as the keyword ?everyone?, then
as a user name, and lastly as a group name. To specify a user or group named
everyone?, use the -u or -g options. To specify a group with the same name as a
user, use the -g options.
However, when I tried it, it was not recognized:
[root]# zfs allow
unrecognized command ''allow''
Any thoughts or suggestions would be much appreciated!
Thank you very much
This message posted from opensolaris.org
Nabeel Saad
2007-Nov-15 17:42 UTC
[zfs-discuss] cannot mount ''mypool'': Input/output error
I appreciate the different responses that I have gotten. As some of you may
have realized I am not a guru in Linux / Solaris...
I have been trying to figure out what file system my Solaris box was using... I
got a comment from Paul that from the fdisk command he could see that most
likely the partitions are Solaris UFS... I don''t see that information
anywhere, so I''m wondering if I missed something, or if you are
assuming this Paul?
I am sure I will not use ZFS to its fullest potential at all.. right now
I''m trying to recover the dead disk, so if it works to mount a single
disk/boot disk, that''s all I need, I don''t need it to be very
functional. As I suggested, I will only be using this to change permissions and
then return the disk into the appropriate Server once I am able to log back into
that server.
I will try the zfs import just to give it a go. I have done modprobe fuse and
have it loaded... but the fact that allow is not available in the latest version
clears up why that wasn''t working...
Sorry Darren, I was not sure what the CC Forums really did and I just chose ones
that I thought might be related to ZFS not realized that Crypto is probably
another project...
I got another suggestion that the file system is UFS, which would make me think
that mount -t ufs /dev/sda1 /mnt/mymount should work, but given that that fails
with
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
or too many mounted file systems
some thing is not right... but that''s probably more a linux community
discussion topic... thanks thought.
Thanks for your suggestion Mark, I will look in the linux FUSE although I do
have a feeling we downloaded the Solaris FUSE software and put it on a linux
box... I''ll have to look into that some more.
Thank you for your responses...
This message posted from opensolaris.org
On Nov 15, 2007 9:42 AM, Nabeel Saad <nabeel at percussion.com> wrote:> I am sure I will not use ZFS to its fullest potential at all.. right now I''m trying to recover the dead disk, so if it works to mount a single disk/boot disk, that''s all I need, I don''t need it to be very functional. As I suggested, I will only be using this to change permissions and then return the disk into the appropriate Server once I am able to log back into that server.(Sorry, forgot to CC the list.) Ok, so assuming that all you want to do is mount your old Solaris disk and change some permissions, then there is probably an easier solution which is to put the hard drive back in the original machine and boot from a (Open)Solaris CD or DVD. This eliminates the whole Linux/FUSE issues you''re getting into. Your easiest option might be to try the new OpenSolaris Developer Preview distribution since it''s actually a Live CD which would give you a full GUI and networking to play with. http://www.opensolaris.org/os/downloads/ Once the Live CD boots, you should be able to mount your drive to an alternate path like /a and then change permissions. If you boot from a regular Solaris CD or DVD it will start the install process, but then you should be able to simply cancel the install and get to a command line and work from there. Good luck! Regards, -Eric