Internal SATA mount bay 1
April 09, 2022 09:58AM
Hi,
today I'm fighting with samba :)

The first point is indeed to mount my HDD that was already mounted with the stock system.

After some study I found this command to work:

mount -o rw,loop,offset=$((2048*512)) /dev/sda2 /srv/nsa325/

The point is that in no way I could manage to automount it at the system boot.

I tried to put the command in rc.local but is does not work
I tried to make a script and call the script in rc.local but ... as above
I tried in fstab but either I could not find the right string or it is not working.

I am sure someone more has already solved this :)
Re: Internal SATA mount bay 1
April 09, 2022 07:25PM
Can you provide the output of "lsblk -f" before and after you issue the mount command above that you indicate works for you?

Ray
Re: Internal SATA mount bay 1
April 10, 2022 02:22AM
YES.

BEFORE
root@debian:/etc/network# lsblk -f
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUN                                                                                                             TPOINT
sda
|-sda1
|    ext2   1.0         0f1b4806-89db-4c26-8eae-ab98b5a023a9
`-sda2
     linux_ 1.2   NSA325:0
                        20f70310-7a8f-ddcd-bce5-e6f194937a3c
  `-md0
     ext4   1.0         304a4dce-e926-4081-a5f7-a308c5d320cf
sdb
`-sdb1
     ext3   1.0   rootfs
                        ff3347e4-3f9e-455b-8617-18b75b021477   25.1G     7% /
mtdblock0

mtdblock1

mtdblock2

mtdblock3

mtdblock4

mtdblock5

mtdblock6

mtdblock7

mtdblock8

root@debian:/etc/network#

AFTER
root@debian:/etc/network# mount -o rw,loop,offset=$((2048*512)) /dev/sda2 /srv/nsa325/
[ 2496.228310][  T549] loop0: detected capacity change from 0 to 3905995905srv/ns
[ 2496.266668][  T549] loop_set_status: loop0 () has still dirty pages (nrpages=1)
[ 2496.546620][  T549] loop0: detected capacity change from 3905995905 to 3905993857
[ 2497.258829][  T549] EXT4-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended
root@debian:/etc/network# lsblk -f
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
loop0
     ext4   1.0         304a4dce-e926-4081-a5f7-a308c5d320cf    1.2T    34% /srv/nsa32
sda
|-sda1
|    ext2   1.0         0f1b4806-89db-4c26-8eae-ab98b5a023a9
`-sda2
     linux_ 1.2   NSA325:0
                        20f70310-7a8f-ddcd-bce5-e6f194937a3c
  `-md0
     ext4   1.0         304a4dce-e926-4081-a5f7-a308c5d320cf
sdb
`-sdb1
     ext3   1.0   rootfs
                        ff3347e4-3f9e-455b-8617-18b75b021477   25.1G     7% /
mtdblock0

mtdblock1

mtdblock2

mtdblock3

mtdblock4

mtdblock5

mtdblock6

mtdblock7

mtdblock8

root@debian:/etc/network#

The best would be to put it in fstab because than it is also unmounted at the power-off.
As it is now seems to create capacity change effect as reported above.
Re: Internal SATA mount bay 1
April 10, 2022 05:56AM
miazza Wrote:
-------------------------------------------------------
>
> root@debian:/etc/network# mount -o rw,loop,offset=$((2048*512)) /dev/sda2 /srv/nsa325/
> [ 2496.228310][  T549] loop0: detected capacity change from 0 to 3905995905srv/ns
> [ 2496.266668][  T549] loop_set_status: loop0 () has still dirty pages (nrpages=1)
> [ 2496.546620][  T549] loop0: detected capacity change from 3905995905 to 3905993857
> [ 2497.258829][  T549] EXT4-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended
>
>
Do you see the above last line with a warning? It recommends you to manually clean your partition table (that may already be dirty). Just run e2fsck device where the device is the partition. Do a man e2fsck to find out more information what this utility can do. For me, I just usually execute fsck -fy device to clean partition tables on all my Linux boxes. Hopefully, your system will automatically mount the partition during the booting process after this.
Re: Internal SATA mount bay 1
April 10, 2022 07:43AM
Quote

loop0
     ext4   1.0         304a4dce-e926-4081-a5f7-a308c5d320cf    1.2T    34% /srv/nsa32
sda
|-sda1
|    ext2   1.0         0f1b4806-89db-4c26-8eae-ab98b5a023a9
`-sda2
     linux_ 1.2   NSA325:0
                        20f70310-7a8f-ddcd-bce5-e6f194937a3c
  `-md0
     ext4   1.0         304a4dce-e926-4081-a5f7-a308c5d320cf
Can't you just mount /dev/md0? It's the same volume.
Re: Internal SATA mount bay 1
April 10, 2022 11:51AM
Mijzelf Wrote:
-------------------------------------------------------
>
Quote

> loop0
>      ext4   1.0        
> 304a4dce-e926-4081-a5f7-a308c5d320cf    1.2T   
> 34% /srv/nsa32
> sda
> |-sda1
> |    ext2   1.0        
> 0f1b4806-89db-4c26-8eae-ab98b5a023a9
> `-sda2
>      linux_ 1.2   NSA325:0
>                        
> 20f70310-7a8f-ddcd-bce5-e6f194937a3c
>   `-md0
>      ext4   1.0        
> 304a4dce-e926-4081-a5f7-a308c5d320cf
> 
> Can't you just mount /dev/md0? It's the same
> volume.
It was so easy ... I do not know why I did not see it... it was so hard for me to find the way with loopback...
Thank you !
 mount -t auto /dev/md0 /srv/nsa325/
[ 2332.797601][  T492] EXT4-fs (md0): warning: maximal mount count reached, runn                                                                                                             ing e2fsck is recommended
[ 2333.143127][  T492] EXT4-fs (md0): mounted filesystem with ordered data mode.                                                                                                              Opts: (null). Quota mode: none.

How should the fstab look like for this mount ?



Edited 1 time(s). Last edit at 04/10/2022 12:30PM by miazza.
Re: Internal SATA mount bay 1
April 10, 2022 12:33PM
No. md0 is the first raid array. As it's assembled automatically, it's probably a single disk raid1 array.

The mtd blocks normally don't show up in blkid as it's content is too low level to have an UUID.

A possible fstab entry could be
/dev/md0 /srv/nsa32 ext4 defaults 0 0
Re: Internal SATA mount bay 1
April 10, 2022 12:45PM
Dear Mijzelf : THANK YOU.

I lost two nights without asking and trying myself :)
Re: Internal SATA mount bay 1
April 10, 2022 02:56PM
habibie Wrote:
-------------------------------------------------------
> Do you see the above last line with a warning? It
> recommends you to manually clean your partition
> table (that may already be dirty). Just run
> e2fsck device where the device is the
> partition. Do a man e2fsck to find out more
> information what this utility can do. For me, I
> just usually execute fsck -fy device to
> clean partition tables on all my Linux boxes.
> Hopefully, your system will automatically mount
> the partition during the booting process after
> this.

This is what I get:
e2fsck /srv/nsa325
e2fsck 1.46.2 (28-Feb-2021)
e2fsck: Is a directory while trying to open /srv/nsa325

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

because I do not know what I'm doing and I have some important data on that HDD I'm a bit afraid to go on alone ;)

this is the reason why fdisk is reporting that partition as "unknown":
Device     Boot   Start        End    Sectors  Size Id Type
/dev/sda1            63    1028159    1028097  502M  8 AIX
/dev/sda2       1028160 3907024064 3905995905  1.8T 20 unknown

With this situation I can boot with stock FW and with debian and I see the disk in both environment.
Whatever change I make, I need the above not to change :)
Re: Internal SATA mount bay 1
April 10, 2022 08:54PM
miazza Wrote:
> This is what I get:
>
> e2fsck /srv/nsa325
> e2fsck 1.46.2 (28-Feb-2021)
> e2fsck: Is a directory while trying to open
> /srv/nsa325
> 
> The superblock could not be read or does not
> describe a valid ext2/ext3/ext4
> filesystem.  If the device is valid and it really
> contains an ext2/ext3/ext4
> filesystem (and not swap or ufs or something
> else), then the superblock
> is corrupt, and you might try running e2fsck with
> an alternate superblock:
>     e2fsck -b 8193 <device>
>  or
>     e2fsck -b 32768 <device>
>
As indicated by the message you are using an incorrect syntax for the e2fsck command. The command requires a device not a mount path as its argument. So you need the following command:
e2fsck /dev/md0

Ray
Re: Internal SATA mount bay 1
April 11, 2022 12:55PM
This is what happened:

root@debian:~# e2fsck /dev/md0
e2fsck 1.46.2 (28-Feb-2021)
/dev/md0 has been mounted 291 times without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inode 78121674 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122555 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122582 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122594 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122609 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122646 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122647 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122688 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122725 extent tree (at level 1) could be shorter.  Optimize<y>? yes
Inode 78122761 extent tree (at level 1) could be shorter.  Optimize ('a' enables 'yes' to all) <y>? yes
Inode 78128354 extent tree (at level 1) could be shorter.  Optimize ('a' enables 'yes' to all) <y>? yes to all
Inode 78153358 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78258008 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78258188 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78258229 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78258231 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78258233 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78259244 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78259245 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78259246 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78259250 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78261423 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78261425 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78261427 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78261430 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78261673 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78261682 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78262228 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78262493 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78264621 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78264622 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78265019 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78265106 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78265242 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266260 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266267 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266272 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266274 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266276 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266422 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266424 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266426 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266428 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78266825 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78267018 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268376 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268433 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268487 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268543 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268754 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268780 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268784 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268787 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268788 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268790 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78268791 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78270296 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78384805 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78384822 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78384952 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78384957 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78384961 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78386526 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78386527 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78386530 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78386531 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78386544 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78386901 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78387134 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78387135 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78387165 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78387172 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78387179 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78387181 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78387195 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388037 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388044 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388055 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388056 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388058 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388059 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388066 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388586 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388909 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388912 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78388921 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78410560 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78410679 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78529948 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78774411 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78788222 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78789526 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78807630 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78905657 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78906207 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78906289 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78909072 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 78909083 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79036592 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79036599 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79036758 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037150 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037154 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037157 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037174 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037287 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037288 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037397 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037458 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037459 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037460 extent tree (at level 1) could be shorter.  Optimize? yes

Inode 79037571 extent tree (at level 1) could be shorter.  Optimize? yes

Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/md0: ***** FILE SYSTEM WAS MODIFIED *****
/dev/md0: 211929/122068992 files (0.4% non-contiguous), 172128031/488249232 blocks
root@debian:~# maunt -a
-bash: maunt: command not found
root@debian:~# mount -a
[  863.672706][  T558] EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
root@debian:~# cd /srv/nsa325
root@debian:/srv/nsa325# ls
.   .media   Private  admin        lost+found  nfs    public
..  .system  Public   aquota.user  music       photo  video
root@debian:/srv/nsa325#
it seems OK now.
Thanks.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: