LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How can gdb be used to find out why this command fails ? [/dev/sdb] (https://www.linuxquestions.org/questions/linux-software-2/how-can-gdb-be-used-to-find-out-why-this-command-fails-%5B-dev-sdb%5D-4175535812/)

Glenn D. 03-05-2015 02:45 AM

How can gdb be used to find out why this command fails ? [/dev/sdb]
 
Hello.
How can gdb be used to find out why this command fails ? see [1]
Thanks Glenn

[1]
# md /media/disk
# mount -t reiser4 /dev/sdb /media/disk
mount: mount(2) failed: No such file or directory

# ll /lib/modules/`uname -r`/kernel/fs/reiser4
total 733
-rw-r--r-- 1 root root 747680 Feb 16 12:34 reiser4.ko

gdb is installed.

Thanks Glenn
------------

other details
=============

--plug disk in

[ 1042.111807] usb 1-1: SerialNumber: ST32000542 5XW1ZMG4
[ 1042.113859] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1042.114236] scsi host5: usb-storage 1-1:1.0
[ 1043.116050] scsi 5:0:0:0: Direct-Access ST320005 42AS PQ: 0 ANSI: 2
[ 1043.117192] sd 5:0:0:0: Attached scsi generic sg2 type 0
[ 1043.117242] sd 5:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
[ 1043.120559] sd 5:0:0:0: [sdb] Write Protect is off
[ 1043.120566] sd 5:0:0:0: [sdb] Mode Sense: 38 00 00 00
[ 1043.123571] sd 5:0:0:0: [sdb] No Caching mode page found
[ 1043.123579] sd 5:0:0:0: [sdb] Assuming drive cache: write through

# rpm installed
###############

# rpm -qa | grep -i reiser4 |sort
kernel-reiser4-3.18.7-1.1.gd2bbe7f.x86_64
kernel-reiser4-debugsource-3.18.6-2.1.gd2bbe7f.x86_64
libreiser4-1_0-9-1.0.9-1.3.x86_64
reiser4progs-1.0.9-58.1.x86_64
reiser4progs-debuginfo-1.0.9-56.1.x86_64

# details about rpm reiser4progs
################################

Description :
A set of commands for using the Reiser4 file system, including mkfs.reiser4

#rpm reiser4progs content:
#########################

rpm -qlp reiser4progs-1.0.9-58.1.x86_64.rpm
warning: reiser4progs-1.0.9-58.1.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 5b40f0db: NOKEY
/usr/sbin/debugfs.reiser4
/usr/sbin/fsck.reiser4
/usr/sbin/make_reiser4
/usr/sbin/measurefs.reiser4
/usr/sbin/mkfs.reiser4
/usr/share/doc/packages/reiser4progs
/usr/share/doc/packages/reiser4progs/BUGS
/usr/share/doc/packages/reiser4progs/COPYING
/usr/share/doc/packages/reiser4progs/ChangeLog
/usr/share/doc/packages/reiser4progs/NEWS
/usr/share/doc/packages/reiser4progs/README
/usr/share/doc/packages/reiser4progs/TODO
/usr/share/man/man8/debugfs.reiser4.8.gz
/usr/share/man/man8/fsck.reiser4.8.gz
/usr/share/man/man8/measurefs.reiser4.8.gz
/usr/share/man/man8/mkfs.reiser4.8.gz

# partition format details
##########################

# fsck.reiser4 --build-fs --force /dev/sdb

Fscking the /dev/sdb block device.

***** fsck.reiser4 started at Thu Mar 5 16:54:06 2015
Reiser4 fs was detected on /dev/sdb.
Master super block (16):
magic: ReIsEr4
blksize: 4096
format: 0x0 (format40)
uuid: 3006ced1-7490-4ea8-a9b8-d82143c6bede
label: <none>

Format super block (17):
plugin: format40
description: Disk-format plugin.
version: 0
magic: ReIsEr40FoRmAt
mkfs id: 0x1ddaf754
flushes: 0
blocks: 488378640
free blocks: 217146980
root block: 37017218
tail policy: 0x2 (smart)
next oid: 0xedade
file count: 188313
tree height: 6
key policy: LARGE

veerain 03-05-2015 04:09 AM

Quote:

Originally Posted by Glenn D. (Post 5327180)
# md /media/disk
# mount -t reiser4 /dev/sdb /media/disk
mount: mount(2) failed: No such file or directory


But md is perhaps DOS way of creating directory.

In linux you use:

Code:

mkdir /media/disk
Please try and report.

Glenn D. 03-05-2015 10:11 PM

Hello,

Details:
mkdir /media/disk

# cd /media/

/media # ll
total 0
drwxr-xr-x 2 root users 48 Mar 6 00:11 disk

# cd /media/disk

# ll
total 0

Question:

What sdb commands do I use to determine why mount command fails:

# mount -t reiser4 /dev/sdb /media/disk
mount: mount(2) failed: No such file or directory
Thanks Glenn

veerain 03-05-2015 11:49 PM

sdb is the name of block device representing your whole hard disk(secondary). It is the way linux accesses a hard disk.

Try this:

Code:

modprobe reiser4
mount -t reiser4 /dev/sdb /media/disk

List the output of command:

Code:

fdisk -l /dev/sdb
and
fdisk -l


rtmistler 03-06-2015 08:27 AM

GDB is the GnuDebugger.

You would normally use it if you had source code compiled with symbols so that you could debug a program.

Odds are that you do not have the source for mount readily available, however it is very possible to obtain that source, rebuild it with symbols, and then perform some debug.

HOWEVER, you do not need to go to that level to diagnose this issue. You just need to figure out how to use the mount command. Veerain is on the way to helping you with that. Basically you need to determine the type of disk partition which you are attempting to mount and then tailor the arguments for the mount command to perform the operation. You also need to get the syntax for mount correctly as well and need to be root or sudo, which you already appear to be.

So for now just realize that GDB is not a general debugger for system commands and it's really a debugger for source code debugging. It is very powerful, just not the tool which will benefit you in this particular case.


All times are GMT -5. The time now is 04:53 AM.