All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arno Steffen <arno.steffen@googlemail.com>
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: error!: "/dev/ubi0" is not a character device ?!?
Date: Thu, 5 Aug 2010 13:55:02 +0200	[thread overview]
Message-ID: <AANLkTikZb=R=8BObvTN6uGaZGAmvvUZd4oYKvkCJih7H@mail.gmail.com> (raw)
In-Reply-To: <1280471755.2838.29.camel@localhost.localdomain>

2010/7/30 Artem Bityutskiy <dedekind1@gmail.com>:
> On Wed, 2010-07-28 at 13:04 +0200, Arno Steffen wrote:
>> Thanks Artem,
>> I am using a 2.6.33 kernel, this should be new enough. It is right,
>> that it is as a block device (in  /dev/ ) ?
>
> No, _all_ UBI devices are character devices. New UBIFS can mount these
> character devices, old UBIFS cannot, and requires deviceless mounting.
>
> As documented here:
>
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mount_ubifs
>
> 2.6.33 indeed should be able to mount /dev/ubi0_0.
>
> But because your system is strange in a way that your UBI devices are
> block devices, this does not work.
>
>> [root@or:/]# ubiattach /dev/ubi_ctrl -m 8 -d 8
>> UBI: attaching mtd8 to ubi8
>> UBI: physical eraseblock size:   131072 bytes (128 KiB)
>> UBI: logical eraseblock size:    129024 bytes
>> UBI: smallest flash I/O unit:    2048
>> UBI: sub-page size:              512
>> UBI: VID header offset:          512 (aligned 512)
>> UBI: data offset:                2048
>> UBI warning: ubi_eba_init_scan: cannot reserve enough PEBs for bad PEB
>> handling, reserved 1, need 3
>> UBI: attached mtd8 to ubi8
>> UBI: MTD device name:            "extra"
>> UBI: MTD device size:            41 MiB
>> UBI: number of good PEBs:        331
>> UBI: number of bad PEBs:         1
>> UBI: max. allowed volumes:       128
>> UBI: wear-leveling threshold:    4096
>> UBI: number of internal volumes: 1
>> UBI: number of user volumes:     1
>> UBI: available PEBs:             0
>> UBI: total number of reserved PEBs: 331
>> UBI: number of PEBs reserved for bad PEB handling: 1
>> UBI: max/mean erase counter: 1/0
>> UBI: image sequence number: 228182237
>> UBI: background thread "ubi_bgt8d" started, PID 386
>> UBI device number 8, total 331 LEBs (42706944 bytes, 40.7 MiB),
>> available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
>> [root@or:/]# ll /dev/ubi*
>> brw-rw----    1 root     root     253,   0 Jan  1 00:00 /dev/ubi8
>> brw-rw----    1 root     root     253,   1 Jan  1 00:00 /dev/ubi8_0
>> crw-rw----    1 root     root      10,  63 Jan  1 00:00 /dev/ubi_ctrl
>
> Wrong. Everything has to be character devices.
>
>> [root@or:/]#
>> [root@or:/]# mount -t ubifs /dev/ubi8 /tmp
>> mount: mounting /dev/ubi8 on /tmp failed: No such device
>> [root@or:/]# mount -t ubifs /dev/ubi8_0 /tmp
>> mount: mounting /dev/ubi8_0 on /tmp failed: No such device
>
> These do not work because /dev/ubi* have to be chdev.
>
>> [root@or:/]# mount -t ubifs ubi8_0 /tmp
>> mount: mounting ubi8_0 on /tmp failed: No such device
>> [root@or:/]# mount -t ubifs ubi8 /tmp
>> mount: mounting ubi8 on /tmp failed: No such device
>
> Do you have volume 0 on ubi8?
>
> Please, send me ls /sys/class/ubi/ and ls /sys/class/ubi/ubi8/
>
> Also, please, check /proc/devices and make sure ubi is in "Character
> devices" list.
>
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
>
>

Thanks Artem for your mail. To answer you requests:

[root@or:/]# ls -l /sys/class/ubi/
lrwxrwxrwx    1 root     root            0 Jan  1 00:00 ubi8 ->
../../devices/virtual/ubi/ubi8
lrwxrwxrwx    1 root     root            0 Jan  1 00:01 ubi8_0 ->
../../devices/virtual/ubi/ubi8/ubi8_0
-r--r--r--    1 root     root         4096 Jan  1 00:00 version
[root@or:/]# ls -l /sys/class/ubi/ubi8/
-r--r--r--    1 root     root         4096 Jan  1 00:00 avail_eraseblocks
-r--r--r--    1 root     root         4096 Jan  1 00:00 bad_peb_count
-r--r--r--    1 root     root         4096 Jan  1 00:01 bgt_enabled
-r--r--r--    1 root     root         4096 Jan  1 00:00 dev
-r--r--r--    1 root     root         4096 Jan  1 00:00 eraseblock_size
-r--r--r--    1 root     root         4096 Jan  1 00:00 max_ec
-r--r--r--    1 root     root         4096 Jan  1 00:00 max_vol_count
-r--r--r--    1 root     root         4096 Jan  1 00:00 min_io_size
-r--r--r--    1 root     root         4096 Jan  1 00:01 mtd_num
drwxr-xr-x    2 root     root            0 Jan  1 00:01 power
-r--r--r--    1 root     root         4096 Jan  1 00:00 reserved_for_bad
lrwxrwxrwx    1 root     root            0 Jan  1 00:01 subsystem ->
../../../../class/ubi
-r--r--r--    1 root     root         4096 Jan  1 00:00 total_eraseblocks
drwxr-xr-x    3 root     root            0 Jan  1 00:00 ubi8_0
-rw-r--r--    1 root     root         4096 Jan  1 00:01 uevent
-r--r--r--    1 root     root         4096 Jan  1 00:01 volumes_count
[root@or:/]# ls -l /dev/u*
brw-rw----    1 root     root     252,   0 Jan  1 00:00 /dev/ubi8
brw-rw----    1 root     root     252,   1 Jan  1 00:00 /dev/ubi8_0
crw-rw----    1 root     root      10,  63 Jan  1 00:00 /dev/ubi_ctrl
cr--r--r--    1 root     root       1,   9 Jan  1 00:00 /dev/urandom

cat /proc/devices give me back, that  (252 ubi8) is a character device.
But looking above, in /dev it is listed as block device !?!

For me creating entries are not transparent, this happend with
ubiattach. No idea how to force ubiattach to write ubi8 in the
devicelist as character device.
Best regards
Arno

  reply	other threads:[~2010-08-05 11:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 12:00 error!: "/dev/ubi0" is not a character device ?!? Arno Steffen
2010-07-26 13:14 ` Artem Bityutskiy
2010-07-26 13:49   ` Arno Steffen
2010-07-27 15:25     ` Artem Bityutskiy
2010-07-28 11:04       ` Arno Steffen
2010-07-30  6:35         ` Artem Bityutskiy
2010-08-05 11:55           ` Arno Steffen [this message]
2010-08-05 13:23             ` twebb
2010-08-05 13:36             ` Artem Bityutskiy
     [not found]             ` <AANLkTikkRNqnEX0PkHigv=zT+Z36J52DEtoVeMGbBExf@mail.gmail.com>
2010-08-16 11:27               ` Arno Steffen
2010-08-23 12:34                 ` Artem Bityutskiy
2010-08-23 14:13                   ` Arno Steffen
2010-08-23 14:41                     ` Artem Bityutskiy
2010-08-24  8:32                       ` Arno Steffen
2010-08-24  8:53                         ` Artem Bityutskiy
2010-08-24  9:19                           ` Arno Steffen
2010-08-24  9:33                             ` Artem Bityutskiy
2010-07-30  6:23     ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTikZb=R=8BObvTN6uGaZGAmvvUZd4oYKvkCJih7H@mail.gmail.com' \
    --to=arno.steffen@googlemail.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.