new ext4 detection for puppy linux

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

new ext4 detection for puppy linux

#1 Post by Jesse »

Barry asked me to have a look at getting guess_fstype to identify ext4 partitions with the tag 'ext4' rather than what it did previously and incorrectly with 'ext3'.

I have had a quick look and I believe I've made the right changes to make the distinction correctly. For those interested in using ext4 with Puppy Linux, and are happy doing terminal window testing, please download the binary and have a go, and please report any correct or incorrect behavior, along with how you expected things to work.

guess_fstype is just a utility to identify a file system type and report back, the types are vfat/ext2/ext3/ext4/iso9660/etc...
example:

Code: Select all

# ./guess_fstype /dev/sda1
ext2
Attachments
guess_fstype_withext4_test1.tar.gz
Source code for guess_fstype, plus binary.
(17.24 KiB) Downloaded 776 times
guess_fstype_withext4_test1-bin.tar.gz
Just the binary executable file guess_fstype.
(5.08 KiB) Downloaded 790 times

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

#2 Post by Jim1911 »

Jesse,

I have an ext4 partition on my computer and am happy to test your revised guess_fstype in a terminal. However, I have little experience in installations from a .tar file. I have unzipped the file to /root/My Applications, what do I do next to make the command available to execute in a terminal?

Jim

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#3 Post by Jesse »

Hi Jim1911,

The .tar file is simply a container for linux files and directories.
When you extracted the .tar file you will have a new directory containing the new guess_fstype executable file.
So you just need to run the new program asking it about your ext4 partition.
So type in something like this in the console (rxvt)

Code: Select all

# cd /root/My Applications
# tar zxvf guess_fstype_withext4_test1-bin.tar.gz
# cd guess_fstype_withext4_test1
# ./guess_fstype /dev/sda1
The "tar zxvf ..." is the command line instruction to extract the tar file, but you can skip that step as you've already done it.
Don't foget to put the ./ before the guess_fstype, because that means to run the program in the current directory rather than the one on the command line auto search list of directories (the PATH environment variable).
You can of course replace the /dev/sda1 with the device partition node of your ext4 partition, e.g. /dev/sdb1, /dev/sdc3, etc...

Jesse

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

#4 Post by Jim1911 »

Jesse,

./guess_fstype /dev/sdb1 correctly identifies my ext4 partition

vfat, ntfs, and ext3 partitions are also correctly identified

Pmount returns error: "unable to mount sdb1"

Do you need further information?
Jim

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#5 Post by Jesse »

Hi Jim1911,

Thats great to hear, thanks for your help testing.
Ok so guess_fstype is now good to go for ext4, but now it is something else that is not correctly setup.

When PMount does the action of asking the kernel to mount the ext4 partition it would run this command:

Code: Select all

mount -t ext4 /dev/sdb1 /mnt/sdb1
Can you please run this command from the command line?, and copy & paste the error message, so that we may see a more exact error message that will help us figure out the next step to fix it.

It may be that the kernel does not have the ext4 filesystem kernel module loaded or compiled in. But the error code from the mount command may help identify the issue.

Jesse

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#6 Post by Jesse »

Hi Jim1911,

You might want to ask the kernel to load the ext4 filesystem module into the kernel, so that it can then mount ext4 filesystems. The command for this is probably:

Code: Select all

modprobe ext4
But it might be something different, do a ls of /lib/modules/2.6.29.2/kernel/fs/ext4/*.ko and that will list the names of the modules that are associated with ext4, hopefully just one, use the name without the .ko extension, with the modprobe command.

Jesse

Joe J
Posts: 7
Joined: Wed 13 May 2009, 11:09
Location: New Jersey, USA

EXT4 Test

#7 Post by Joe J »

Here is the error and the dmesg. There is no ext4 directory in /lib/modules/2.6.29.1/kernel/fs. Modeprobe ext 4 says "Module ext4 not found."

By the way, I replaced my guess_fstype with the new one, but when I mouse over the partition icon on the desktop, it still lists it as ext3.
  • mount: wrong fs type, bad option, bad superblock on /dev/sda5,
    missing codepage or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so
  • EXT4-fs: sda5: Filesystem with huge files cannot be mounted read-write without CONFIG_LBD.
    EXT4-fs: sda5: Filesystem with huge files cannot be mounted read-write without CONFIG_LBD.

Jim1911
Posts: 2460
Joined: Mon 19 May 2008, 20:39
Location: Texas, USA

#8 Post by Jim1911 »

Jesse,

This is the result of the commands you asked me to execute.

# modprobe ext4
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

# dmesg | tail
unionfs: new lower inode mtime (bindex=0, name=cups)
unionfs: new lower inode mtime (bindex=0, name=run)
unionfs: new lower inode mtime (bindex=0, name=cups)
unionfs: new lower inode mtime (bindex=0, name=cups)
unionfs: new lower inode mtime (bindex=0, name=chrome)
EXT3-fs: sdb1: couldn't mount because of unsupported optional features (240).
unionfs: new lower inode mtime (bindex=0, name=.AbiSuite)
EXT4-fs: sdb1: Filesystem with huge files cannot be mounted read-write without CONFIG_LBD.
unionfs: new lower inode mtime (bindex=0, name=run)
EXT4-fs: sdb1: Filesystem with huge files cannot be mounted read-write without CONFIG_LBD.

# dmesg | so
did not return anything

# modprobe ext4
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Module ext4 not found.

# cd /lib/modules/2.6.29.2/kernel/fs/ext4/
bash: cd: /lib/modules/2.6.29.2/kernel/fs/ext4/: No such file or directory
#

After this, I renamed the guess_fstype file and copied the same file from the my-applications/guess_fstype_withext4_test1 directory. No change when I executed the above commands again.

My sdb1 partition is ext4 with Kubuntu 9.04 running on it.

Hope this helps,
Jim

User avatar
paulh177
Posts: 975
Joined: Tue 22 Aug 2006, 20:41

#9 Post by paulh177 »

jesse i ran your new guess_fstype (from the bin+src tarball) against an ext4 ptn created with arch linux, and it returns "unknown"

anything further i can do ?

paul

Joe J
Posts: 7
Joined: Wed 13 May 2009, 11:09
Location: New Jersey, USA

Ext4

#10 Post by Joe J »

Paul,

Did you run the guess_fstype from within puppy. When I tried running it from within Ubuntu, all my partitions came back as "unknown." However when I ran it in puppy, it correctly identified the ext4 partition (as well as the rest). Joe

User avatar
paulh177
Posts: 975
Joined: Tue 22 Aug 2006, 20:41

#11 Post by paulh177 »

excuse me for being a bufffoon (i can tell the difference between puppy and ubuntu but not puppy 4 and upup a6)

Properly tested with alpha6 against apup alpha6, Jesse's scrip works fine

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#12 Post by Jesse »

Hi,

I had a look into this error:
EXT4-fs: sdb1: Filesystem with huge files cannot be mounted read-write without CONFIG_LBD

Large file size enabled file system can only be
mount if kernel is build with CONFIG_LBD

looks like on a 32bit system, if CONFIG_LBD is not enabled when compiling kernel, ext4 volume will can only be mounted in readonly mode, so re-configue the kernel to enable CONFIG_LBD, then I can mount the ext4 volume successfully.

PS: to enable CONFIG_LBD, go to “Main menu

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#13 Post by Jesse »

paulh177 wrote:jesse i ran your new guess_fstype (from the bin+src tarball) against an ext4 ptn created with arch linux, and it returns "unknown"

anything further i can do ?

paul
Hi Paul,
You have to be running as root user for the guess_fstype application to be able to access hard disks (block devices) directly. This isn't a problem on Puppy Linux, but it is on other distros.

Jesse

User avatar
paulh177
Posts: 975
Joined: Tue 22 Aug 2006, 20:41

#14 Post by paulh177 »

Sorry Jesse I've been unclear as well as dumb ...
I created the ptn using Arch but ran the new guess_fstype from a (full) install of 4.1.2 (dumb) which returned unknown.
Realising my dumbness, I ran it again from a (frugal) install of uPup466, which returned the correct fstype (for all my devices btw - ntfs, ext2, ext3 and ext4 partitions were correctly detected)

paul

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#15 Post by amigo »

Wouldn't 'blkid' do what is wanted and maybe more?

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#16 Post by Jesse »

Hi amigo,
Gosh yes, blkid does do more.
But sometimes doing less is better, like for in the initrd/init script, and other shell scripts that just need to know a filesystem type to perform a mount. blkid output will always need some processing if its to be used by a script, where guess_fstype output does not require any processing, its really a case of what tool is better suited for a given job.
Jesse

wingnux
Posts: 1
Joined: Tue 19 May 2009, 16:48

#17 Post by wingnux »

I've recently installed upup a8 on my laptop that was previously running crunchbang linux. I had 2 ext4 partitions (root and home) but noticed that they were incorrectly detected as ext3 during puppy linux install so I've formatted the root partition as ext3 and everything went just fine. The only (and big!) problem is that now I can't read my ext4 partition, running the script returned this output:

#./guess_fstype /dev/sda6
ext4

When trying to mount with "mount -t ext4 /dev/sda6 /mnt/sda6" I got a "wrong fs tpe, bad option..." error and when typing "modprobe ext4" I got this message:

WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Module ext4 not found.

Any help?
Thanks in advance.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#18 Post by BarryK »

alpha 7/8 has ext4 builtin to the kernel, not as a module. Ditto for the 2.6.29.3 kernel that I have just compiled and will be in alpha9.

Jesse,
see my post about static compiling:

http://puppylinux.com/blog/?viewDetailed=00754
[url]https://bkhome.org/news/[/url]

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#19 Post by Jesse »

wingnux wrote:I've recently installed upup a8 on my laptop that was previously running crunchbang linux. I had 2 ext4 partitions (root and home) but noticed that they were incorrectly detected as ext3 during puppy linux install so I've formatted the root partition as ext3 and everything went just fine. The only (and big!) problem is that now I can't read my ext4 partition, running the script returned this output:

#./guess_fstype /dev/sda6
ext4

When trying to mount with "mount -t ext4 /dev/sda6 /mnt/sda6" I got a "wrong fs tpe, bad option..." error and when typing "modprobe ext4" I got this message:

WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Module ext4 not found.

Any help?
Thanks in advance.
Hi, you may be able to mount the partition to access the files in read-only mode. I think its the read-write mode that requires the kernel option.

Code: Select all

mount -o ro -t ext4 /dev/sda6 /mnt/sda6
You can then read your files, but you wont be able to save any changes back to that partition.
Jesse

Jesse
Posts: 466
Joined: Sun 08 May 2005, 16:07
Location: Auckland, NZ

#20 Post by Jesse »

BarryK wrote:alpha 7/8 has ext4 builtin to the kernel, not as a module. Ditto for the 2.6.29.3 kernel that I have just compiled and will be in alpha9.

Jesse,
see my post about static compiling:

http://puppylinux.com/blog/?viewDetailed=00754
Hi Barry,
um, presumably you want the warning to go away?

try changing line ~352
return (sum == p[511]);
to
return (sum == *(p +511));

The warning is in code detecting the "adfs" filesystem so its actually fairly unlikely to impact any puppy system adversely.

Jesse

Post Reply