12-29-2011
Kernel programming - Ext4 and extents contents
Hi there,
I have a problem with Unix kernel programming.
I have to write a program who should output the whole information the EXT4 extents contain. I have found many tutorial and information about how the EXT4 filesystem is working. Also There ar many information about the EXT4 structure but I could not find any information about how can I access the inode structure and get the whole contents of the extents. If anyone there who can help me with this it would be great if he can explain me the way I can do this.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I am looking for a guide on how to program for either the Linux or FreeBSD (includes 4.4BSD, NetBSD or OpenBSD) kernel. I would prefer to learn how to write device drivers, but anything would help.
If you know, please email me at *removed* or leave a post here
Regards,
Farhan (0 Replies)
Discussion started by: Farhan
0 Replies
2. Programming
I want to do kernel programming.So which site or books help me in studying these.I know C programming to a little extent.Please advice me (4 Replies)
Discussion started by: ranjith
4 Replies
3. Linux
Hi All,
Not sure if this is the right place to ask, so please tell me where is appropriate...
Anyway, here is the problem. I'm a bit new to kernel programming, so nothing works :confused: . I need to intercept cetrtain ethernet packets from Host1("eth0") to Host2("eth1") and send them to... (1 Reply)
Discussion started by: sl_king
1 Replies
4. Linux
:)
Hi,
I intend to learn kernel programming.
Please, let me know if have know any good books for learning or any sites which will be help me.
Thanks in advance.
-
masg (1 Reply)
Discussion started by: masg1
1 Replies
5. UNIX for Advanced & Expert Users
I write kernel module with kernel threads using
linux/kthread.h on 2.6.* kernel
I tried to passing data between two kernel threads
with data argument of kthread_run( fun, data , NAME );
but this is not work I dont know why. I tried many possibility
and nothing works.
So I thought that... (0 Replies)
Discussion started by: marcintom
0 Replies
6. UNIX for Advanced & Expert Users
Hi
I'd like to know a logic or a strategy to count the number of I/O requests that are being made. I have the PID of the process for which this needed to be done. Does anyone have any clue as to how to do this? This is to be done in Kernel programming in C.
P.S:
This is to be done in... (2 Replies)
Discussion started by: Ir1s
2 Replies
7. Fedora
Hi Friends,
This is my first ever post on this forum. I am a new user in the Linux field. Although, I have been working for sometime with CentOS at my work, I would consider myself an amateur only in this field. :D
The way file system works in linux and the reason its open-source, has really... (7 Replies)
Discussion started by: rohitrajjain
7 Replies
8. IP Networking
hi there
so, i was given an assignment: implement a linux system call that blocks all packets that are sent to a given IP (i have to do it without using iptables)
i'm really new to kernel programming btw (and i'm enjoying it a lot)
so, my syscall is called ip_block() and receives a... (1 Reply)
Discussion started by: lgfaria
1 Replies
9. UNIX for Advanced & Expert Users
Hi there
At first.
My Name is Andre, 27 and im from germany
Im tryin to learn something about the Unix Kernel and System
At first im trying to manipulate the systemcalls
I want to have an Entry in the kernel logfile, whenever a new file is created.
I found out, that a file uses the... (0 Replies)
Discussion started by: kissthechief
0 Replies
10. Ubuntu
I have found many source files in the kernel using goto keyword instead of just doing the actual thing. For example:
if(blah)
goto x;
--
--
--
--
--
x: return blah-blah
Is there any specific reason for writing the code like this? The first thought that came to my mind is minimizing... (0 Replies)
Discussion started by: BHASKAR JUPUDI
0 Replies
LEARN ABOUT REDHAT
lvreduce
LVREDUCE(8) System Manager's Manual LVREDUCE(8)
NAME
lvreduce - reduce the size of a logical volume
SYNOPSIS
lvreduce [-A|--autobackup {y|n}] [-d|--debug] [-f|--force] [-h|--help] {-l|--extents [-]LogicalExtentsNumber| -L|--size [-]LogicalVolume-
Size[kKmMgGtT]} [-v|--verbose] LogicalVolumePath
DESCRIPTION
lvreduce allows you to reduce the size of a logical volume. Be careful when reducing a logical volume's size, because data in the reduced
part is lost!!!
You should therefore ensure that the (eg) filesystem on the volume is resized running lvreduce so that the extents that are to be removed
are not in use. If the filesystem is ext2 then you can use the e2fsadm(8) command to both resize the filesystem and the logical volume
together. Shrinking snapshot logical volumes (see lvcreate(8) for information to create snapshots) is supported as well.
OPTIONS
-A, --autobackup y/n
Controls automatic backup of VG metadata after the change ( see vgcfgbackup(8) ). Default is yes.
-d, --debug
Enables additional debugging output (if compiled with DEBUG).
-f, --force
Force size reduction without any question.
-h, --help
Print a usage message on standard output and exit successfully.
-l, --extents [-]LogicalExtentsNumber
Reduce or set the logical volume size in units of logical extents. With the - sign the value will be subtracted from the logical
volume's actual size and without it the will be taken as an absolute size.
-L, --size [-]LogicalVolumeSize[kKmMgGtT]
Reduce or set the logical volume size in units of megabyte by default. A size suffix of k for kilobyte, m for megabyte, g for giga-
byte or t for terabyte is optional. With the - sign the value will be subtracted from the logical volume's actual size and without
it the will be taken as an absolute size.
-v, --verbose
Gives verbose runtime information about lvreduce's activities.
Example
"lvreduce -l -3 /dev/vg00/lvol1" reduces the size of logical volume lvol1 in volume group vg00 by 3 logical extents.
DIAGNOSTICS
lvreduce returns an exit code of 0 for success and > 0 for error:
1 no logical volume name on command line
2 invalid logical volume name
3 logical volume is not active
4 logical volume doesn't exist
5 error reading VGDA
6 error getting index of logical volume
7 new size of logical volume not smaller than old one
8 error setting VGDA up for reduce
9 error reducing logical volume in kernel
10 error writing VGDA to physical volume(s)
11 error getting index for read/write statistic transfer
12 error getting status of logical volume from kernel
13 error setting up copy on write exception table
95 driver/module not in kernel
96 invalid I/O protocol version
97 error locking logical volume manager
98 invalid lvmtab (run vgscan(8))
99 invalid command line
ENVIRONMENT VARIABLES
LVM_AUTOBACKUP
If this variable is set to "no" then the automatic backup of VG metadata is turned off.
LVM_VG_MAX_BACKUPS
This variable determins the backup history depth of kept VGDA copy files in /etc/lvmconf. It can be set to a positive number between
0 and 999. The higher this number is the more steps are you able to backup with vgcfgrestore(8) from the changes you make to your
volume groups.
LVM_VG_NAME
The default Volume Group Name to use. Setting this variable enables you to enter just the Logical Volume Name rather than its com-
plete path.
See also
lvm(8), lvcreate(8), lvextend(8), lvchange(8), e2fsadm(8)
AUTHOR
Heinz Mauelshagen <Linux-LVM@Sistina.com>
Heinz Mauelshagen LVM TOOLS LVREDUCE(8)