Author Topic: New versions of fdisk and e2fsprogs  (Read 21112 times)

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #30 on: September 24, 2004, 05:15:54 pm »
Quote
Here Tony, I had some trouble finding this:
http://www.zaurususergroup.com/modules.php...20for%20newbies

Thanks.    I found this site previously and it gave me the base knowledge I was using here.  It doens't offer a solution to this "read-only file system" problem...

What is a "read only file system"?  Why would Linux ever have one?  Is linux incorrectly reading the device as ROM?  Is there a internal data setting for this on the MMC card?

Quote
QUOTE 
# fdisk /dev/mmcda1



I note you keep writing this, hopefully it's just a typo, as it should be this:

fdisk /dev/mmcda

as mmcda1 is a partition and fdisk works on the device.

Yes, I'm using MMCDA1.

Code: [Select]
# umount /dev/mmcda
umount: /dev/mmcda: invalid argument
# umount /dev/mmcda1
#

The partitions themselves, from what I understand, are called: MMCDA1P1, MMCDA1P2, etc...

but... having said that, I tried MMCDA for fdisk... and it works!    

Code: [Select]
# fdisk /dev/mmcda

Command (m for help): o
...

It worked... and I noticed that I got an extra cylinder doing it this way (1006 instead of 1005).  I then did mkfs.vfat /dev/mmcda (without the 1) and that worked.

Then I did fsck.vfat /dev/mmcda (without the 1) and that worked too...

but...

Code: [Select]
# mount /dev/mmcda
Can't find /dev/mmcda in /etc/fstab
# mount /dev/mmcda1
mount: Mounting /dev/mmcda1 on /mnt/card failed: Invalid argument
#

So... I think before I was creating a partition within a partition?  That might explain the read-only FS status... but why can't I mount the new VFAT FS now?

What is /etc/fstab?

Thanks again!
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #31 on: September 24, 2004, 05:31:49 pm »
Oops... I misread what you wrote.  I tried it again.  In SU I did:

* fdisk /dev/mmcda
* mkfs.vfat /dev/mmcda1
* fsck.vfat /dev/mmcda1
(reported 0 files, 0/63359 clusters)
* mount /dev/mmcda1
(The device mounted and the icon showed up)

...but...

Code: [Select]
# cd /mnt/card
# mkdir test
# ls
test
# rmdir test
# ls
# exit
bash-2.05$ cd /mnt/card
bash-2.05$ mkdir test
mkdir: Cannot create directory 'test': Permission denied
bash-2.05$

Wow!  This is the farthest I've ever gotten with this on the Zaurus!   Now I only have some strange permissions thing going...

Should I have formated the card outside of SU?
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #32 on: September 24, 2004, 05:43:56 pm »
I tried formating the card from outisde of SU, but it says:

Code: [Select]
bash-2.05$ mkfs.vfat /dev/mmcda1
mkfs.vfat 2.8 (28 Feb 2001)
mkfs.vfat: unable to open /dev/mmcda1
bash-2.05$

So... formating can only be done while in SU?

Code: [Select]
# cd /mnt
# ls -l
lrwxrwxrwx    1 root       root       17 Nov 27  2003 card -> usr/mnt.rom/card
lrwxrwxrwx    1 root       root       15 Nov 27  2003 cf -> usr/mnt.rom/cf
etc...
# cd /usr/mnt.rom
# ls -l
lrwxrwxrwx    3 root       root   16384 Dec 31 1969 card
lrwxr-xr-x    2 root       root       0 May 20  2002 cf
etc...

What is 1 Root, 2 Root and 3 Root?  Why is the card directory date Dec 31, 1969?  Why are the permissions different?  Could this by my problem?
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

katufzed

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.projectgalileo.org.uk
New versions of fdisk and e2fsprogs
« Reply #33 on: September 24, 2004, 09:43:29 pm »
Try rebooting ur Z & see if that solves the problem.

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #34 on: September 24, 2004, 11:58:27 pm »
I rebooted the Zaurus and reinserted the card.  The card came up with the Documents and Install_Files directories, which is a good sign... it means that Zaurus was able to automatically create them... but I still think there's some weird problem with writing to the card.  Check this out:

Code: [Select]
bash-2.05$ cd /mnt/card
bash-2.05$ ls
Documents      Install_Files
bash-2.05$ mkdir test
bash-2.05$ ls

Now you see it, now you don't?  I'm guessing the 2nd ls didn't show anything because the card is "busy" trying to finish the mkdir command...

Could it be a bad sectore or 2?  I'll try checking it...
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #35 on: September 25, 2004, 12:00:48 am »
Code: [Select]
# umount /dev/mmcda1
umount: /dev/mmcda1: Device or resource busy
#

It looks like I was right... the card is locked up waiting for the mkdir command to complete...
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
New versions of fdisk and e2fsprogs
« Reply #36 on: September 25, 2004, 03:20:51 am »
Tony,

Could you please say what version comes back with ...

fdisk -v

Regards,

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #37 on: September 25, 2004, 08:47:17 am »
Quote
Could you please say what version comes back with ...

fdisk -v

Code: [Select]
# which fdisk
/usr/sbin/fdisk
# fdisk -v
fdisk v2.12a
#                    

It's looking at the right place, and I installed the fdisk at the beginning of this thread... so hopefully that should be the correct version.

Code: [Select]
# fsck.vfat /dev/mmcda1 -a -t -v -V -w
dosfsck 2.8 (28 Feb 2001)
dosfsck 2.8, 28 Feb 2001, FAT32, LFN
Boot sector contents:
System ID "mkdosfs"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
     16384 bytes per cluster
         1 reserved sector
First FAT starts at byte 512 (sector 1)
         2 FATs, 16 bit entries
    126976 bytes per FAT (= 248 sectors)
Root directory starts at byte 254464 (sector 497)
       512 root directory entries
Data area starts at byte 270848 (sector 529)
     63359 data clusters (1038073856 bytes)
63 sectors/track, 32 heads
         0 hidden sectors
   2028032 sectors total
Starting check/repair pass.
Checking for bad clusters.
Reclaiming unconnected clusters.
Starting verification pass.
Checking for unused clusters.
/dev/mmcda1: 6 files, 0/63359 clusters
#                                          

That means that my Zaurus was able to read and write (at a low level) to and from every single bit on the MMC card, I assume.  It also means that it couldn't find any problems with the card, right?  (Assuming I'm reading this right... if there WERE problems, I assume it would display them here.)  That would mean that the card is fine, and I don't need to worry about returning it, and the problems are os/application related (is that correct? ....I worry since I hear so many stories about bad SD cards... and I got this one for so cheap... I worried that it may have been a dud...)

Above, in the fsck output, it says "2 FATs, 16 bit entries".  What does that mean?  I thought FAT was the information at the beginning of the partition... how coukd I has 2 of them?  ...is one of them a backup copy, or does it indicate that I have 2 partitions with FAT16 on them?

Since I had previously ejected and reinserted the MMC card, I tried my mkdir test again...

Code: [Select]
# cd /mnt/card
# ls
Documents      Install_Files  test
# mkdir test2
# ls
#        

I think I might be on to something here... The "test" directory I made last night is there (which means it actually wrote it), but when I tried creating "test2", they all disappeared again.  Here's what I suspect might be happening (let me know what you think): When the Z writes to the card, it write the data, updates the main FAT but then has problems updating the backup FAT (FAT #2?),  so it sits there waiting for something... but when the card is ejected/reinserted then the data and FAT #1 are still there and working fine... until something else needs to update the data and both FATs.

Does sound like a good theory?  Would that imply a problem in mksf in how the backup FAT (FAT #2) was created, or would that mean there's a problem with how Linux on Z is writing to the FATs?

Has anyone out there succesfully tested VFAT on a 1 GB MMC on your Zaurus?  Maybe this bug only happens past the 1 GB barrier... (should I try repartition to 900 MB and 100 MB partitions?)

Should I try the "Win95 FAT16 (LBA)" instead of "FAT16" (#6)?  ...or how about any of the other FAT16 cousins on that long list?  

Thanks again for everyone's help so far!  
« Last Edit: September 25, 2004, 09:11:07 am by TonyOlsen »
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #38 on: September 25, 2004, 09:39:26 am »
Another new finding... The MMC card remains busy whenever I do something that requires the MMC Card's FAT tables to update... until I eject the card.  But I noticed that simply suspending the Zaurus has the same effect.  Suspending the Zaurus causes Linux to give up on what it was forever waiting for.  So... in the QTopia GUI, in the Files tab, I can go to the SD Card (MMC) and see the "test" and "test2" directory I created.  I create a "test3" directory and all directories suddenly disappear.  I suspend/restore the Zaurus and that same screen suddenly has all of the previous folders, including the new "test3".

Interesting.

If we could only find what Zaurus is attempting/waiting to do, then we could either fix the problem of why it's waiting and/or get Linux to stop attempting to do what it does everytime it updates the FATs.

Any ideas?  
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
New versions of fdisk and e2fsprogs
« Reply #39 on: September 25, 2004, 10:48:52 am »
Whoa, lots of posts :-)

Quote
Oops... I misread what you wrote. I tried it again. In SU I did:

* fdisk /dev/mmcda
* mkfs.vfat /dev/mmcda1
* fsck.vfat /dev/mmcda1
(reported 0 files, 0/63359 clusters)
* mount /dev/mmcda1
(The device mounted and the icon showed up)

This is correct.

Quote
So... formating can only be done while in SU?

Yes. su allows a user to change to another (super)user. su on it's own changes you to the root user. By default zaurus can't format partitions, only root can (it's a dnagerous process for a normal user to be able to perform). Therefore yes, you must su to root before you can format, etc.

Quote
What is 1 Root, 2 Root and 3 Root? Why is the card directory date Dec 31, 1969? Why are the permissions different? Could this by my problem?

No; google up 'man ls' for an explanation. Not sure about the date (I didn't think pre 1969 was possible, odd), but probably not a problem anyway.

Quote
bash-2.05$ mkdir test

As FAT has no permissions, the entire partition is automatically owned by root. Therefore only root can write to it by default. To alter this (so zaurus can write to it) edit fstab. This is dangerous, I'd search the forum or get someone to give you the exact flags (can't remember off the top of my head) to add otherwise you may end up not being able to mount anything at all (including the ROM)!

A couple of other points:

If you are currently in a directory on the card, it will be busy and cannot be umounted.

Forcing the umount (or just ejecting it before it has been umounted) may well result in filesystem corruption.


Si
« Last Edit: September 25, 2004, 10:56:25 am by lardman »
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #40 on: September 25, 2004, 12:17:54 pm »
Thanks!  That was a lot of good information to know.  

I tried a variation of the umount...

Code: [Select]
bash-2.05$ cd /mnt/card
bash-2.05$ ls
Documents      Install_Files  test           test2          test3
bash-2.05$ mkdir test4
bash-2.05$ ls
bash-2.05$ cd ..
bash-2.05$ ls
card  cf    ide   net   smb
bash-2.05$ umount /dev/mmcda1
umount: /dev/mmcda1: Operation not permitted
bash-2.05$ umount /dev/mmcda
umount: /dev/mmcda: Invalid argument
bash-2.05$    

The problem with umount here appears to be something more than simply being in the directory.

Another test:

After the above input happened, I clicked on the SD icon in the system tray and selected "Eject SD-card".  A message window said "Failed to eject the card.  Please eject the card after you close all applications and turn off the Zaurus.".  When I closed the terminal and clicked on the GUI to eject the card, it umounted (ejected) without a problem.

I reinserted the card and attempted to create a test5 directory, and ls suddenly was empty again.  When closed the terminal and reopened it, it was still empty (ie. the resources were still busy).

The system is busy writing to the device (mmc).  Somehow it appears to be stuck up on something... but whatever it is stuck up on isn't 100% necessary since the directory appears correctly after the card is ejected/reinserted.  Does anyone else think that my theory is on to something here?

Above in my posts I showed the permissions to the mounted mmc card directory.  If I'm reading that correctly, that card should be open to the whole world.  ..doesn't that mean that there shouldn't be any permissions problems with creating directories in that card?
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
New versions of fdisk and e2fsprogs
« Reply #41 on: September 25, 2004, 12:26:06 pm »
Quote
The problem with umount here appears to be something more than simply being in the directory.

Only superusers (root) can umount things.

Quote
After the above input happened, I clicked on the SD icon in the system tray and selected "Eject SD-card". A message window said "Failed to eject the card. Please eject the card after you close all applications and turn off the Zaurus.". When I closed the terminal and clicked on the GUI to eject the card, it umounted (ejected) without a problem.

Possibly because of what I said above - was the terminal's current directory somewhere on the card?

Quote
I reinserted the card and attempted to create a test5 directory, and ls suddenly was empty again. When closed the terminal and reopened it, it was still empty (ie. the resources were still busy).

Did you check mount to see that it had been mounted?

Quote
it was still empty (ie. the resources were still busy

This is not necessarily the reason... I think the id est is possibly a little premature :-)

Quote
Above in my posts I showed the permissions to the mounted mmc card directory. If I'm reading that correctly, that card should be open to the whole world. ..doesn't that mean that there shouldn't be any permissions problems with creating directories in that card?

The permissions of the directory on which it's mounted make no difference, fstab is the thing to look at.


Si
« Last Edit: September 25, 2004, 12:28:29 pm by lardman »
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

TonyOlsen

  • Hero Member
  • *****
  • Posts: 554
    • View Profile
    • http://www.userdimensions.com/Tony/Resume.html
New versions of fdisk and e2fsprogs
« Reply #42 on: September 25, 2004, 01:21:20 pm »
Quote
Quote
The problem with umount here appears to be something more than simply being in the directory.

Only superusers (root) can umount things.

I know.  I was in SU at the time.  Above, whenever you see "#" before the commands, then I'm in SU (logged in as root or super user).  Whenever you see "bash-2.05$" then I'm outside of SU.  Most of my stuff has been inside SU (just to make sure permissions aren't a problem.

Quote
Quote
After the above input happened, I clicked on the SD icon in the system tray and selected "Eject SD-card". A message window said "Failed to eject the card. Please eject the card after you close all applications and turn off the Zaurus.". When I closed the terminal and clicked on the GUI to eject the card, it umounted (ejected) without a problem.

Possibly because of what I said above - was the terminal's current directory somewhere on the card?

Yes, I was.  Your point was correct.  

I did the test again and although it still wouldn't show anything in the card directory (although now sometimes it shows the directory, although without the changes I made in the card directory, such as adding another "test" directory.

...BUT... if I "cd .." then "cd card" then "ls" then the new directory is there.

That's improvement... what happened?

This still doesn't solve the larger problem, though.  Why doesn't Linux let ls see the updates until after I leave the directory?  What is it trying to do which requires my absence from the directory before doing it?

Quote
Quote
I reinserted the card and attempted to create a test5 directory, and ls suddenly was empty again. When closed the terminal and reopened it, it was still empty (ie. the resources were still busy).

Did you check mount to see that it had been mounted?

I don't know how to check a mount other than performing a mount/umount.  The icon was showing so I assumed it was mounted.  So far it's been pretty consistant that the icon shows up when it's mounted and disappears when it is unmounted.

Attempting to delete one of my test folders from the QTopia GUI Files tab (after if asks me if I'm sure) causes the files tab to forever freeze.  Forever... meaning it's still frozen now...

Quote
fstab is the thing to look at.

Ok.  What's fstab?  Where is it?  How does it work?  How do I change/update it?

Thanks!
« Last Edit: September 25, 2004, 01:31:39 pm by TonyOlsen »
Tony Olsen
Ferris@Myself.Com
Resume
Zaurus SL-C860 QTopia
2 GB Static CF
1 GB MMC (although it isn't working yet)
My Quest: To get an x86 emulator working on my Zaurus and to have my Zaurus replace my laptop as my MAIN computer
Publically available Videos for the default Zaurus SL-C860 video player

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
New versions of fdisk and e2fsprogs
« Reply #43 on: September 25, 2004, 02:18:03 pm »
lol

Quote
I know. I was in SU at the time.

You sure.... (perhaps it was just a typo in your post?)?:

Quote
I tried a variation of the umount...

<snip>

Code: [Select]
bash-2.05$ cd /mnt/card
bash-2.05$ ls
Documents      Install_Files  test           test2          test3
bash-2.05$ mkdir test4
bash-2.05$ ls
bash-2.05$ cd ..
bash-2.05$ ls
card  cf    ide   net   smb
bash-2.05$ umount /dev/mmcda1
umount: /dev/mmcda1: Operation not permitted
bash-2.05$ umount /dev/mmcda
umount: /dev/mmcda: Invalid argument
bash-2.05$    

Quote
I don't know how to check a mount other than performing a mount/umount.

Just type 'mount' with no arguments.

Quote
Ok. What's fstab? Where is it? How does it work? How do I change/update it?

Google for 'man fstab' or similar, far easier than my trying to explain (rusty memory and beer don't help ;-)


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
New versions of fdisk and e2fsprogs
« Reply #44 on: September 25, 2004, 02:43:55 pm »
Hello,
Post the output of
Code: [Select]
cat /etc/fstab
Greg