uw-unsat / yggdrasil

31 stars 7 forks source link

Issues with mount #2

Closed xxks-kkk closed 6 years ago

xxks-kkk commented 6 years ago

Hello,

I'm trying to mount the Yxv6 file system by executing

python2 yav_xv6_main.py -o max_read=4096 -o max_write=4096 -s a -- /dev/sXX

I got the following error message:

>> /dev/sXX
>> number of inodes = 32768
>> fs size = 128 MB
>> sync = False
Creating partition: 0 1
Creating partition: 1 2
Creating partition: 2 1026
Creating partition: 1026 33794
Creating partition: 33794 34821
Creating partition: 34821 34822
Traceback (most recent call last):
  File "yav_xv6_main.py", line 14, in <module>
    run()
  File "yav_xv6_main.py", line 5, in run
    yav_dirimpl_fuse.main()
  File "yav_dirimpl_fuse.pyx", line 460, in yav_dirimpl_fuse.main (yav_dirimpl_fuse.c:6661)
    inode_obj = create_fuse_inode(fargs)
  File "xv6inode.py", line 385, in xv6inode.create_fuse_inode (xv6inode.c:7163)
    txndisk = WALDisk(logdisk, [freedisk, inodedisk, inodedisk, datadisk, ifreedisk, orphandisk], osync=args.sync)
  File "waldisk.py", line 24, in waldisk.WALDisk.__init__ (waldisk.c:1867)
    self.__recover()
  File "waldisk.py", line 134, in waldisk.WALDisk.__recover (waldisk.c:4102)
    hdr_bid1 = self._logdisk.read(self.LOG_BID_HEADER_BLOCK)
  File "diskimpl.pyx", line 164, in diskimpl.PartitionAsyncDisk.read (diskimpl.c:5469)
    return self.adisk.read(blknum + self.start)
  File "diskimpl.pyx", line 124, in diskimpl.AsyncDisk.read (diskimpl.c:4152)
    assert nbytes == BLOCKSIZE, "async disk: could not read entire blocksize"
AssertionError: async disk: could not read entire blocksize

I'm guessing I need to create a container image and setup the mount point. So I did the following:

# assuming inside yggdrasil repo
mkdir a
dd if=/dev/zero of=theFile.img bs=1M count=256 conv=noerror,sync
python yav_xv6_main.py -o max_read=1024 -o max_write=1024 -s a -- theFile.img

Then the program hang

>> theFile.img
>> number of inodes = 32768
>> fs size = 128 MB
>> sync = False
Creating partition: 0 1
Creating partition: 1 2
Creating partition: 2 1026
Creating partition: 1026 33794
Creating partition: 33794 34821
Creating partition: 34821 34822
Killed

Is it the expected behavior? How do I mount the file system and make sure it is successfully mounted? I think I can see the file system using df -Th?

Thanks much for the help!

xxks-kkk commented 6 years ago

The program hang is the expected behavior. If we fire up another window and cd into the mount point and do some file operations (e.g. less or rm), there will be corresponding log printout in the hang window.