ext2 partition not mounted at boot

johnbock

Mitglied
Mitglied seit
2 Mrz 2008
Beiträge
310
Punkte für Reaktionen
0
Punkte
0
I have a swap device (sda1) and a ext2 partition (sda2) on a sandisk microdisk 20GB connected to the box at boot. With a patched rc.swap swap is now being properly activated at boot.

In the event mask of avm's webcfg I get this
04.04.08 01:24:14 Der USB-Massenspeicher 2 enthält kein unterstütztes Dateisystem oder hat eine ungültige Partitionstabelle. (Das Gerät hat den folgenden Typ: 0c0b:b136)

04.04.08 01:24:13 Partition unter uStor00 eingebunden

04.04.08 01:24:06 USB-Gerät 002, Klasse 'storage', angesteckt
Manually mounting the device works:spocht:
Code:
/var/mod/root # mount 
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
dev on /dev type tmpfs (rw,nosuid)
proc on /proc type proc (rw,nosuid,nodev,noexec)
ramfs on /var type ramfs (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
usbfs on /proc/bus/usb type usbfs (rw)

/var/mod/root # mount -o noatime,nodiratime /dev/sda2 /var/media/ftp/uStor00
/var/mod/root # mount 
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
dev on /dev type tmpfs (rw,nosuid)
proc on /proc type proc (rw,nosuid,nodev,noexec)
ramfs on /var type ramfs (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda2 on /var/media/ftp/uStor00 type ext2 (rw,noatime,nodiratime)


BTW
Code:
/var/mod/root # begin=$(date +%s); dd if=/dev/zero of=/var/media/ftp/uStor00/test bs=$((1024*1024*100)) count=1; done=$(date +%s); echo "copied $((1024*1024*100)) bytes in $(($done-$begin)) seconds => $(((1024*1024*100)/($done-$begin)))B/s"
1+0 records in
1+0 records out
copied 104857600 bytes in 6 seconds => 17476266B/s
/var/mod/root # hdparm -Tt /dev/sda

/dev/sda:
Timing buffer-cache reads:    34 MB in 0.52 seconds = 66953 kB/s
Timing buffered disk reads:   33 MB in 3.03 seconds = 11152 kB/s
I find it odd that writing should be faster than reading:rolleyes: But I think it goes to show how good linux goes with ext2;)
 
I think cold plugging is the problem here...

Could we link /etc/fstab into flash?

Or is there another way? I'd like run fsck over the partition before mounting it.
 
Yup, but I read it again.

I don't use usbroot. Or do I? Is that this automount thing?



Looking at the hotplug scripts: we could hook into block device events.
If they're configured mount them to there configured mountpoint. And when not configured mount them with the default system.

How can I link /etc/fstab into flash?

What do you guys think?
 
Nein, aber swap
Ich ändere das hier mal, denn selbiges PRoblem tritt auch auch bei einer Swapparition und weiteren Datenträgern, allerdings ohne den Reboot.

Wobei die Swappartition nciht mehr iengebunden wird automatisch, wenn ein weiteres Device eingehängt wird.
 
I think, I've found the problem. It seems as if only the first partition is being properly handled in /etc/hotplug/usb.pandu. The events come so fast, that the first event is still locked when the second event comes 'round.

A possible solution, decouple the event resolution: no locking (don't know why it's been implemented like it is?)

Using hotplug block events we can trigger mount/swapon on swap/ext2/ext3/ext4/ntfs/vfat (vfat and other fats must be tested) dependent of the partition uuid. This requires blkid from the e2fstools package. Running blkid on my box I get
Code:
/var/mod/root # blkid /dev/sda1
/dev/sda1: UUID="a43c59fa-8c6c-4ab1-9fb5-56055bbb84e9" TYPE="swap" 
/var/mod/root # blkid /dev/sda2
/dev/sda2: UUID="8767bfe9-6747-4937-81c3-eb56d1b76d22" TYPE="ext2" 
/var/mod/root #
and on my laptop
Code:
/dev/sda1: TYPE="ntfs" UUID="4850E2D350E2C6B2" 
/dev/sda3: TYPE="swap" UUID="4be0c278-54cf-4e11-9610-49e70a6b6d29" 
/dev/sda4: UUID="b7cf1fa1-e5cc-40f4-ac7b-e1d7a3d35c00" TYPE="reiserfs" 
/dev/sda5: TYPE="ntfs" UUID="4444409544408B9C" LABEL="Daten"
The uuid is boot-safe, meaning the uuid is the same even after a reboot;)

The file /etc/blkid.tab seems to be not required. A configuration file linking mountpoint to uuid, mount options and anything else useful. A cgi front end and naturally the script working on the block hotplug events.

Here is the patch for blkid
Code:
Index: make/e2fsprogs/e2fsprogs.mk
===================================================================
--- make/e2fsprogs/e2fsprogs.mk (revision 2083)
+++ make/e2fsprogs/e2fsprogs.mk (working copy)
@@ -8,6 +8,8 @@
 $(PKG)_MKE2FS_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/mke2fs
 $(PKG)_TUNE2FS_BINARY:=$(E2FSPROGS_DIR)/misc/tune2fs
 $(PKG)_TUNE2FS_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/tune2fs
+$(PKG)_E2BLKID_BINARY:=$(E2FSPROGS_DIR)/misc/blkid
+$(PKG)_E2BLKID_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/blkid
 $(PKG)_LIB_BINARY:=$($(PKG)_DIR)/lib/uuid/libuuid.a
 $(PKG)_LIB_STAGING_BINARY:=$(TARGET_TOOLCHAIN_STAGING_DIR)/usr/lib/libuuid.a
 
@@ -33,6 +35,9 @@
 $($(PKG)_TUNE2FS_TARGET_BINARY): $($(PKG)_TUNE2FS_BINARY)
        $(INSTALL_BINARY_STRIP)
 
+$($(PKG)_E2BLKID_TARGET_BINARY): $($(PKG)_E2BLKID_BINARY)
+       $(INSTALL_BINARY_STRIP)
+
 $($(PKG)_LIB_STAGING_BINARY): $($(PKG)_LIB_BINARY)
        PATH=$(TARGET_TOOLCHAIN_PATH) \
                $(MAKE) -C $(E2FSPROGS_DIR)/lib/uuid \
@@ -46,6 +51,7 @@
 $(pkg)-precompiled: $($(PKG)_E2FSCK_TARGET_BINARY) \
                        $($(PKG)_MKE2FS_TARGET_BINARY) \
                        $($(PKG)_TUNE2FS_TARGET_BINARY) \
+                       $($(PKG)_E2BLKID_TARGET_BINARY) \
                        $($(PKG)_LIB_STAGING_BINARY)
 
 $(pkg)-clean:

My next task is to implement the file /etc/hotplug/block.pandu and configuration files. My intention is to map the incoming events to uuid's and mountpoints, and then to mount them. No separate rc script will be necessary, in fact when done, rc.swap will be obsolete.
 
No separate rc script will be necessary, in fact when done, rc.swap will be obsolete.
For swap on partitions, that is. Swap on files will still require a rc script.

Anyways, it would be nice if patches were added to the corresponding ticket (or a new one, if we consider this a new feature rather than a bugfix).
 
Your right, swapfiles require rc.swap.

I put the e2fsprogs patch here hoping someone could see if blkid also works on vfat, fat12, fat16 and fat32 partitions.
 
Have you seen fstyp prog in Freetz? Perhaps this could do the job also?

Greets Oliver
 
fstyp can't create an UUID. IMHO is required to uniquely identify a partition to mount per configuration.

For example, I have two sticks, the first contains a partition p1 and the second partition p2. When connected both will be recognized as sda1. With p1 I want to let the default routines mount it. p2 on the other hand should be mounted at /var/opt.

With the present system that isn't possible.
 
I've looked into the complete hotplug system of the 7270. Wow is that overly complex. It may have been easier/faster to define various hotplug scripts to work for specific tasks. The one usb.pandu script does all of the plugging, too much! And all that waiting for devices to come up.

It would have much easier and efficient to load a module at a specific stage and let hotplug to tell me the device is ready. Then I could load the next module and let hotplug to tell me the partition is ready. And finally mount it.

Hotplug tells me when I need to do something and how: just let it work... And you'll have a lot less problems with locking and the like. It would probably be a little quicker to boot.
 
I've compiled the complete image with -O2 instead of -Os. The my original image had 647680B free, the -O2 (kernel too) image had 553472B free.

After flashing and rebooting both my partitions where automatically mounted. Now, I'm almost 100% sure there's a locking problem in the current hotplug system:rolleyes:

I'm gonna watch my system over the next few days to ensure it remains stable.

Before I forget. I'm just about done with the new hotplug implementation.
 
Kostenlos!

Statistik des Forums

Themen
248,917
Beiträge
2,305,042
Mitglieder
378,638
Neuestes Mitglied
Patrick89