On 27/08/2021 12:22, Graham Perrin wrote:

… sswap(1) to securely delete whatever might be there. …


I took an opportunity to experiment with some of the other utilities that were recently installed by security/secure_delete and security/wipe. All new to me.

With reference to the attached file, a few points of interest. Some of it's PEBKAM, I don't mind sharing my mistakes.

I'll report what might be an obscure bug in lsblk.

----

Line 5, misuse of srm – `srm -lv /dev/da0p3` – was followed by peculiar output from a run of lsblk. No surprise there.

Lines 131–139, gdisk should have added freebsd-swap at /dev/da0p3, I ignored the suggestion to remove the hard disk drive ("Warning: The kernel may continue to use old or deleted partitions."), gpart then showed nothing (free space) where da0p3 was expected.

Line 152, I used gpart to add freebsd-swap at da0p3.

Lines 288–297, gdisk should have deleted /dev/da0p3, I ignored the suggestion to remove the drive, lsblk showed da0p3 still present.

Lines 301–359, tail of /var/log/messages whilst I disconnected then reconnected the multi-purpose dock in which the drive was seated.

Line 375, with nothing in the SD card reader at da0, lsblk showed freebsd-swap.

Lines 379–383, with the hard disk drive at da4, lsblk showed nothing (free space) between da4p2 and da4p4 – the preceding deletion by gdisk was a success.

Lines 418–430, gdisk succesfully added freebsd-swap at /dev/da4p3 – the partition was detected by lsblk _without_ the need to disconnect then reconnect the dock.

----

I disconnected then reconnected the dock, lsblk continues to show what I might describe as a 'ghost' where truly there's nothing in the SD card reader at da0.

da0, where previously there was the hard disk drive on the JMicron USB to ATA/ATAPI bridge.

root@mowa219-gjp4-8570p-freebsd:~ # sswap -lv /dev/da0p3
Error: Target is not a block device - /dev/da0p3
root@mowa219-gjp4-8570p-freebsd:~ # sswap -lv da0p3
Error: Can't open da0p3 for writing.No such file or directory
root@mowa219-gjp4-8570p-freebsd:~ # srm -lv /dev/da0p3
Using /dev/urandom for random input.
Wipe mode is insecure (two passes [0xff/random])
Wiping /dev/da0p3 Warning: /dev/da0p3 is not a regular file, rename/unlink 
only!Warning: Couldn't rename /dev/da0p3 - Operation not supported
 Removed file /dev/da0p3 ... Done
root@mowa219-gjp4-8570p-freebsd:~ # wipe -nv /dev/da0p3
wipe: cannot stat `/dev/da0p3': No such file or directory
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              0:181 466G GPT                                               - 
-
  da0p1          0:184 200M efi                                  msdosfs/EFISYS 
-
  da0p2          0:188 512K freebsd-boot                           gpt/gptboot0 
-
  <FREE>         -:-   492K -                                                 - 
-
stat: /dev/da0p3: stat: No such file or directory
stat: /dev/da0p3: stat: No such file or directory
  da0p3        16G:freebsd-swap    - SWAP                                       
         
  da0p4          0:193 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  da0p4.eli      0:196 450G zfs                                               - 
-
  <FREE>         -:-   4.0K -                                                 - 
-
root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da0
GPT fdisk (gdisk) version 1.0.8

NOTE: Write test failed with error number 1. It will be impossible to save
changes to this disk's partition table!
You may be able to enable writes by exiting this program, typing
'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this
program.

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): q
root@mowa219-gjp4-8570p-freebsd:~ # mount | grep da0
root@mowa219-gjp4-8570p-freebsd:~ # gpart show da0
=>       40  976773088  da0  GPT  (466G)
         40     409600    1  efi  (200M)
     409640       1024    2  freebsd-boot  (512K)
     410664        984       - free -  (492K)
     411648   33554432    3  freebsd-swap  (16G)
   33966080  942807040    4  freebsd-zfs  (450G)
  976773120          8       - free -  (4.0K)

root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da0
GPT fdisk (gdisk) version 1.0.8

NOTE: Write test failed with error number 1. It will be impossible to save
changes to this disk's partition table!
You may be able to enable writes by exiting this program, typing
'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this
program.

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): q
root@mowa219-gjp4-8570p-freebsd:~ # gpart delete -i 3 da0
da0p3 deleted
root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da0
GPT fdisk (gdisk) version 1.0.8

NOTE: Write test failed with error number 1. It will be impossible to save
changes to this disk's partition table!
You may be able to enable writes by exiting this program, typing
'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this
program.

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): q
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              0:181 466G GPT                                               - 
-
  da0p1          0:184 200M efi                                  msdosfs/EFISYS 
-
  da0p2          0:188 512K freebsd-boot                           gpt/gptboot0 
-
  <FREE>         -:-    16G -                                                 - 
-
  da0p4          0:193 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  da0p4.eli      0:196 450G zfs                                               - 
-
  <FREE>         -:-   4.0K -                                                 - 
-
root@mowa219-gjp4-8570p-freebsd:~ # sysctl kern.geom.debugflags=16
kern.geom.debugflags: 0 -> 16
root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da0
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): n
Partition number (3-128, default 3): 
First sector (410664-976773127, default = 410664) or {+-}size{KMGTP}: 
Last sector (410664-33966079, default = 33966079) or {+-}size{KMGTP}: 
Current type is A503 (FreeBSD UFS)
Hex code or GUID (L to show codes, Enter = A503): L
Type search string, or <Enter> to show all codes: swap
8200 Linux swap                          a502 FreeBSD swap                      
a582 Midnight BSD swap                   a901 NetBSD swap                       
bf02 Solaris swap                        
Hex code or GUID (L to show codes, Enter = a503): a502
Changed type of partition to 'FreeBSD swap'

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/da0.
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
root@mowa219-gjp4-8570p-freebsd:~ # gpart show da0
=>       40  976773088  da0  GPT  (466G)
         40     409600    1  efi  (200M)
     409640       1024    2  freebsd-boot  (512K)
     410664   33555416       - free -  (16G)
   33966080  942807040    4  freebsd-zfs  (450G)
  976773120          8       - free -  (4.0K)

root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              0:181 466G GPT                                               - 
-
  da0p1          0:184 200M efi                                  msdosfs/EFISYS 
-
  da0p2          0:188 512K freebsd-boot                           gpt/gptboot0 
-
  <FREE>         -:-    16G -                                                 - 
-
  da0p4          0:193 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  da0p4.eli      0:196 450G zfs                                               - 
-
  <FREE>         -:-   4.0K -                                                 - 
-
root@mowa219-gjp4-8570p-freebsd:~ # gpart add -t freebsd-swap -i 3 da0
da0p3 added
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              0:181 466G GPT                                               - 
-
  da0p1          0:184 200M efi                                  msdosfs/EFISYS 
-
  da0p2          0:188 512K freebsd-boot                           gpt/gptboot0 
-
  da0p3          2:89   16G freebsd-swap                                      - 
SWAP
  da0p4          0:193 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  da0p4.eli      0:196 450G zfs                                               - 
-
  <FREE>         -:-   4.0K -                                                 - 
-
root@mowa219-gjp4-8570p-freebsd:~ # smartctl -a /dev/da0 | grep Reallocated
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       
-       328 (0 40)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       
-       40
root@mowa219-gjp4-8570p-freebsd:~ # sswap -lv /dev/da0p3
Error: Target is not a block device - /dev/da0p3
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              0:181 466G GPT                                               - 
-
  da0p1          0:184 200M efi                                  msdosfs/EFISYS 
-
  da0p2          0:188 512K freebsd-boot                           gpt/gptboot0 
-
  da0p3          2:89   16G freebsd-swap                                      - 
SWAP
  da0p4          0:193 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  da0p4.eli      0:196 450G zfs                                               - 
-
  <FREE>         -:-   4.0K -                                                 - 
-
root@mowa219-gjp4-8570p-freebsd:~ # wipe -nv /dev/da0p3
wipe: zero length, skipping `/dev/da0p3'
root@mowa219-gjp4-8570p-freebsd:~ # wipe -v -o | buffer > /dev/da0p3
buffer: Command not found.
root@mowa219-gjp4-8570p-freebsd:~ # wipe -v -o | gdd bs=10M of=/dev/da0p3
^C0+92543 records in
0+92543 records out
6064898048 bytes (6.1 GB, 5.6 GiB) copied, 192.255 s, 31.5 MB/s
root@mowa219-gjp4-8570p-freebsd:~ # pkg provides bin/buffer
Name    : piglit-20200910_1
Desc    : Automated OpenGL and OpenCL testsuite
Repo    : FreeBSD
Filename: usr/local/lib/piglit/bin/bufferstorage-persistent_gles3
          usr/local/lib/piglit/bin/bufferstorage-persistent

Name    : buffer-1.19
Desc    : Buffer sporadic I/O for faster tape and pipe throughput
Repo    : FreeBSD
Filename: usr/local/bin/buffer
root@mowa219-gjp4-8570p-freebsd:~ # pkg install --quiet --yes buffer
=====
Message from buffer-1.19:

--
===>   NOTICE:

The buffer port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
root@mowa219-gjp4-8570p-freebsd:~ # wipe -v -o | buffer > /dev/da0p3
^Croot@mowa219-gjp4-8570p-freebsd:~ 
root@mowa219-gjp4-8570p-freebsd:~ # time wipe -v -o | buffer > /dev/da0p3
buffer (writer): write of data failed: No error: 0
bytes to write=10240, bytes written=8192, total written   16777700K
21.985u 5.446s 21:33.49 2.1%    24+168k 0+0io 0pf+0w
root@mowa219-gjp4-8570p-freebsd:~ # smartctl -a /dev/da0 | grep Reallocated
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       
-       328 (0 40)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       
-       40
root@mowa219-gjp4-8570p-freebsd:~ # wipe -v -o | gdd status=progress bs=24M 
of=/dev/da0p3
17150836736 bytes (17 GB, 16 GiB) copied, 537 s, 31.9 MB/s 
gdd: error writing '/dev/da0p3': No space left on device
0+262152 records in
0+262151 records out
17180372992 bytes (17 GB, 16 GiB) copied, 537.95 s, 31.9 MB/s
root@mowa219-gjp4-8570p-freebsd:~ # smartctl -a /dev/da0 | grep Reallocated
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       
-       328 (0 40)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       
-       40
root@mowa219-gjp4-8570p-freebsd:~ # sysctl kern.geom.debugflags=0
kern.geom.debugflags: 16 -> 0
root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da0
GPT fdisk (gdisk) version 1.0.8

NOTE: Write test failed with error number 1. It will be impossible to save
changes to this disk's partition table!
You may be able to enable writes by exiting this program, typing
'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this
program.

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): q
root@mowa219-gjp4-8570p-freebsd:~ # sysctl kern.geom.debugflags=16
kern.geom.debugflags: 0 -> 16
root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da0
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/da0: 976773168 sectors, 465.8 GiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 9434107E-05A6-11E9-9D47-D89D67D37967
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 40, last usable sector is 976773127
Partitions will be aligned on 8-sector boundaries
Total free space is 8 sectors (4.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  efiboot0
   2          409640          410663   512.0 KiB   A501  gptboot0
   3          410664        33966079   16.0 GiB    A502  
   4        33966080       976773119   449.6 GiB   A504  zfs0

Command (? for help): d
Partition number (1-4): 3

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/da0.
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              0:181 466G GPT                                               - 
-
  da0p1          0:184 200M efi                                  msdosfs/EFISYS 
-
  da0p2          0:188 512K freebsd-boot                           gpt/gptboot0 
-
  da0p3          2:89   16G freebsd-swap                                      - 
SWAP
  da0p4          0:193 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  da0p4.eli      0:196 450G zfs                                               - 
-
  <FREE>         -:-   4.0K -                                                 - 
-
root@mowa219-gjp4-8570p-freebsd:~ # tail -f -n 0 /var/log/messages
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: ugen0.5: <JMicron USB to 
ATA/ATAPI bridge> at usbus0 (disconnected)
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: umass0: at uhub6, port 1, 
addr 4 (disconnected)
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da0 at umass-sim0 bus 0 
scbus4 target 0 lun 0
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da0: <HGST HTS 725050A7E630 
>  s/n F050090681FF detached
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: GEOM_ELI: Device da0p4.eli 
destroyed.
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: (da0:umass-sim0:0:0:0): 
Periph destroyed
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: umass0: detached
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: ugen0.6: <Generic Mass 
Storage Device> at usbus0 (disconnected)
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: umass1: at uhub6, port 4, 
addr 5 (disconnected)
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da1 at umass-sim1 bus 1 
scbus5 target 0 lun 0
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da1: <Generic USB SD Reader 
1.00>  s/n 058F312D81B detached
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da2 at umass-sim1 bus 1 
scbus5 target 0 lun 1
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da2: <Generic USB CF Reader 
1.01>  s/n 058F312D81B detached
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da3 at umass-sim1 bus 1 
scbus5 target 0 lun 2
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da3: <Generic USB SM Reader 
1.02>  s/n 058F312D81B detached
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: (da1:umass-sim1:1:0:0): 
Periph destroyed
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da4 at umass-sim1 bus 1 
scbus5 target 0 lun 3
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: da4: <Generic USB MS Reader 
1.03>  s/n 058F312D81B detached
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: (da3:umass-sim1:1:0:2): 
Periph destroyed
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: (da2:umass-sim1:1:0:1): 
Periph destroyed
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: (da4:umass-sim1:1:0:3): 
Periph destroyed
Aug 27 14:22:35 mowa219-gjp4-8570p-freebsd kernel: umass1: detached
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: ugen0.5: <Generic Mass 
Storage Device> at usbus0
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: umass0 on uhub6
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: umass0: <Generic Mass 
Storage Device, class 0/0, rev 2.00/1.29, addr 11> on usbus0
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: da0 at umass-sim0 bus 0 
scbus4 target 0 lun 0
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: da0: <Generic USB SD Reader 
1.00> Removable Direct Access SCSI device
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: da0: Serial Number 
058F312D81B
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: da0: 40.000MB/s transfers
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: da0: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:22:41 mowa219-gjp4-8570p-freebsd kernel: da0: quirks=0x2<NO_6_BYTE>
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da1 at umass-sim0 bus 0 
scbus4 target 0 lun 1
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da1: <Generic USB CF Reader 
1.01> Removable Direct Access SCSI device
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da1: Serial Number 
058F312D81B
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da1: 40.000MB/s transfers
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da1: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da1: quirks=0x2<NO_6_BYTE>
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da2 at umass-sim0 bus 0 
scbus4 target 0 lun 2
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da2: <Generic USB SM Reader 
1.02> Removable Direct Access SCSI device
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da2: Serial Number 
058F312D81B
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da2: 40.000MB/s transfers
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da2: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da2: quirks=0x2<NO_6_BYTE>
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da3 at umass-sim0 bus 0 
scbus4 target 0 lun 3
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da3: <Generic USB MS Reader 
1.03> Removable Direct Access SCSI device
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da3: Serial Number 
058F312D81B
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da3: 40.000MB/s transfers
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da3: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:22:42 mowa219-gjp4-8570p-freebsd kernel: da3: quirks=0x2<NO_6_BYTE>
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: ugen0.6: <JMicron USB to 
ATA/ATAPI bridge> at usbus0
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: umass1 on uhub6
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: umass1: <MSC Bulk-Only 
Transfer> on usbus0
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: da4 at umass-sim1 bus 1 
scbus5 target 0 lun 0
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: da4: <HGST HTS 725050A7E630 
> Fixed Direct Access SCSI-2 device
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: da4: Serial Number 
F050090681FF
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: da4: 40.000MB/s transfers
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: da4: 476940MB (976773168 512 
byte sectors)
Aug 27 14:22:46 mowa219-gjp4-8570p-freebsd kernel: da4: quirks=0x2<NO_6_BYTE>
^C
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              2:95    0B freebsd-swap                                      - 
SWAP
root@mowa219-gjp4-8570p-freebsd:~ # lsblk 
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
ada0             0:121 932G GPT                                               - 
-
  ada0p1         0:123 260M efi                                    gpt/efiboot0 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  ada0p2         0:125  16G freebsd-swap                              gpt/swap0 
SWAP
  ada0p2.eli     2:67   16G freebsd-swap                                      - 
SWAP
  ada0p3         0:127 915G freebsd-zfs                                gpt/zfs0 
<ZFS>
  ada0p3.eli     0:134 915G zfs                                               - 
-
  <FREE>         -:-   708K -                                                 - 
-
cd0              0:129   0B -                                                 - 
-
da0              2:95    0B freebsd-swap                                      - 
SWAP
da1              2:96    0B -                                                 - 
-
da2              2:97    0B -                                                 - 
-
da3              2:98    0B -                                                 - 
-
da4              2:104 466G GPT                                               - 
-
  da4p1          2:105 200M efi                                  msdosfs/EFISYS 
-
  da4p2          2:106 512K freebsd-boot                           gpt/gptboot0 
-
  <FREE>         -:-    16G -                                                 - 
-
  da4p4          2:107 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  <FREE>         -:-   4.0K -                                                 - 
-
da5              0:215 466G GPT                                               - 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  da5p1          0:216 466G freebsd-zfs                           gpt/Transcend 
<ZFS>
da6              0:223  14G GPT                                               - 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  da6p1          0:224  14G freebsd-zfs                     gpt/cache-transcend 
<ZFS>
da7              0:247  29G GPT                                               - 
-
  da7p1          0:248  29G freebsd-zfs                        gpt/cache-august 
<ZFS>
root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da4
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): n
Partition number (3-128, default 3): 
First sector (410664-976773127, default = 410664) or {+-}size{KMGTP}: 
Last sector (410664-33966079, default = 33966079) or {+-}size{KMGTP}: 
Current type is A503 (FreeBSD UFS)
Hex code or GUID (L to show codes, Enter = A503): a502
Changed type of partition to 'FreeBSD swap'

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/da4.
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da0              2:95    0B freebsd-swap                                      - 
SWAP
root@mowa219-gjp4-8570p-freebsd:~ # lsblk da4
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
da4              2:104 466G GPT                                               - 
-
  da4p1          0:184 200M efi                                  msdosfs/EFISYS 
-
  da4p2          0:185 512K freebsd-boot                           gpt/gptboot0 
-
  da4p3          0:186  16G freebsd-swap                     gpt/FreeBSD%20swap 
-
  da4p4          0:187 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  <FREE>         -:-   4.0K -                                                 - 
-
root@mowa219-gjp4-8570p-freebsd:~ # smartctl -a /dev/da0 | grep Reallocated
root@mowa219-gjp4-8570p-freebsd:~ # smartctl -a /dev/da4 | grep Reallocated
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       
-       328 (0 40)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       
-       40
root@mowa219-gjp4-8570p-freebsd:~ # tail -f -n 0 /var/log/messages
Aug 27 14:26:48 mowa219-gjp4-8570p-freebsd kernel: ugen0.6: <JMicron USB to 
ATA/ATAPI bridge> at usbus0 (disconnected)
Aug 27 14:26:48 mowa219-gjp4-8570p-freebsd kernel: umass1: at uhub6, port 1, 
addr 12 (disconnected)
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da4 at umass-sim1 bus 1 
scbus5 target 0 lun 0
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da4: <HGST HTS 725050A7E630 
>  s/n F050090681FF detached
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: (da4:umass-sim1:1:0:0): 
Periph destroyed
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: umass1: detached
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: ugen0.5: <Generic Mass 
Storage Device> at usbus0 (disconnected)
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: umass0: at uhub6, port 4, 
addr 11 (disconnected)
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da0 at umass-sim0 bus 0 
scbus4 target 0 lun 0
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da0: <Generic USB SD Reader 
1.00>  s/n 058F312D81B detached
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da1 at umass-sim0 bus 0 
scbus4 target 0 lun 1
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da1: <Generic USB CF Reader 
1.01>  s/n 058F312D81B detached
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da2 at umass-sim0 bus 0 
scbus4 target 0 lun 2
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da2: <Generic USB SM Reader 
1.02>  s/n 058F312D81B detached
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: (da0:umass-sim0:0:0:0): 
Periph destroyed
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da3 at umass-sim0 bus 0 
scbus4 target 0 lun 3
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: da3: <Generic USB MS Reader 
1.03>  s/n 058F312D81B detached
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: (da1:umass-sim0:0:0:1): 
Periph destroyed
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: (da3:umass-sim0:0:0:3): 
Periph destroyed
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: (da2:umass-sim0:0:0:2): 
Periph destroyed
Aug 27 14:26:49 mowa219-gjp4-8570p-freebsd kernel: umass0: detached
^C
root@mowa219-gjp4-8570p-freebsd:~ # lsblk 
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
ada0             0:121 932G GPT                                               - 
-
  ada0p1         0:123 260M efi                                    gpt/efiboot0 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  ada0p2         0:125  16G freebsd-swap                              gpt/swap0 
SWAP
  ada0p2.eli     2:67   16G freebsd-swap                                      - 
SWAP
  ada0p3         0:127 915G freebsd-zfs                                gpt/zfs0 
<ZFS>
  ada0p3.eli     0:134 915G zfs                                               - 
-
  <FREE>         -:-   708K -                                                 - 
-
cd0              0:129   0B -                                                 - 
-
da5              0:215 466G GPT                                               - 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  da5p1          0:216 466G freebsd-zfs                           gpt/Transcend 
<ZFS>
da6              0:223  14G GPT                                               - 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  da6p1          0:224  14G freebsd-zfs                     gpt/cache-transcend 
<ZFS>
da7              0:247  29G GPT                                               - 
-
  da7p1          0:248  29G freebsd-zfs                        gpt/cache-august 
<ZFS>
root@mowa219-gjp4-8570p-freebsd:~ # tail -f -n 0 /var/log/messages
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: ugen0.5: <Generic Mass 
Storage Device> at usbus0
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: umass0 on uhub6
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: umass0: <Generic Mass 
Storage Device, class 0/0, rev 2.00/1.29, addr 13> on usbus0
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da0 at umass-sim0 bus 0 
scbus4 target 0 lun 0
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da0: <Generic USB SD Reader 
1.00> Removable Direct Access SCSI device
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da0: Serial Number 
058F312D81B
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da0: 40.000MB/s transfers
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da0: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da0: quirks=0x2<NO_6_BYTE>
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da1 at umass-sim0 bus 0 
scbus4 target 0 lun 1
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da1: <Generic USB CF Reader 
1.01> Removable Direct Access SCSI device
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da1: Serial Number 
058F312D81B
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da1: 40.000MB/s transfers
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da1: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da1: quirks=0x2<NO_6_BYTE>
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da2 at umass-sim0 bus 0 
scbus4 target 0 lun 2
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da2: <Generic USB SM Reader 
1.02> Removable Direct Access SCSI device
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da2: Serial Number 
058F312D81B
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da2: 40.000MB/s transfers
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da2: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da2: quirks=0x2<NO_6_BYTE>
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da3 at umass-sim0 bus 0 
scbus4 target 0 lun 3
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da3: <Generic USB MS Reader 
1.03> Removable Direct Access SCSI device
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da3: Serial Number 
058F312D81B
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da3: 40.000MB/s transfers
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da3: Attempt to query device 
size failed: NOT READY, Medium not present
Aug 27 14:27:28 mowa219-gjp4-8570p-freebsd kernel: da3: quirks=0x2<NO_6_BYTE>
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: ugen0.6: <JMicron USB to 
ATA/ATAPI bridge> at usbus0
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: umass1 on uhub6
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: umass1: <MSC Bulk-Only 
Transfer> on usbus0
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: da4 at umass-sim1 bus 1 
scbus5 target 0 lun 0
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: da4: <HGST HTS 725050A7E630 
> Fixed Direct Access SCSI-2 device
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: da4: Serial Number 
F050090681FF
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: da4: 40.000MB/s transfers
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: da4: 476940MB (976773168 512 
byte sectors)
Aug 27 14:27:32 mowa219-gjp4-8570p-freebsd kernel: da4: quirks=0x2<NO_6_BYTE>
^C
root@mowa219-gjp4-8570p-freebsd:~ # lsblk
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL 
MOUNT
ada0             0:121 932G GPT                                               - 
-
  ada0p1         0:123 260M efi                                    gpt/efiboot0 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  ada0p2         0:125  16G freebsd-swap                              gpt/swap0 
SWAP
  ada0p2.eli     2:67   16G freebsd-swap                                      - 
SWAP
  ada0p3         0:127 915G freebsd-zfs                                gpt/zfs0 
<ZFS>
  ada0p3.eli     0:134 915G zfs                                               - 
-
  <FREE>         -:-   708K -                                                 - 
-
cd0              0:129   0B -                                                 - 
-
da0              0:194   0B freebsd-swap                                      - 
SWAP
da1              0:195   0B -                                                 - 
-
da2              0:196   0B -                                                 - 
-
da3              0:197   0B -                                                 - 
-
da4              2:106 466G GPT                                               - 
-
  da4p1          2:107 200M efi                                  msdosfs/EFISYS 
-
  da4p2          2:108 512K freebsd-boot                           gpt/gptboot0 
-
  da4p3          2:109  16G freebsd-swap                     gpt/FreeBSD%20swap 
-
  da4p4          2:110 450G freebsd-zfs                                gpt/zfs0 
<ZFS>
  <FREE>         -:-   4.0K -                                                 - 
-
da5              0:215 466G GPT                                               - 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  da5p1          0:216 466G freebsd-zfs                           gpt/Transcend 
<ZFS>
da6              0:223  14G GPT                                               - 
-
  <FREE>         -:-   1.0M -                                                 - 
-
  da6p1          0:224  14G freebsd-zfs                     gpt/cache-transcend 
<ZFS>
da7              0:247  29G GPT                                               - 
-
  da7p1          0:248  29G freebsd-zfs                        gpt/cache-august 
<ZFS>
root@mowa219-gjp4-8570p-freebsd:~ # sync
root@mowa219-gjp4-8570p-freebsd:~ # geom disk list
Geom name: ada0
Providers:
1. Name: ada0
   Mediasize: 1000204886016 (932G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r2w2e4
   descr: HGST HTS721010A9E630
   lunid: 5000cca8c8f669d2
   ident: JR1000D33VPSBE
   rotationrate: 7200
   fwsectors: 63
   fwheads: 16

Geom name: cd0
Providers:
1. Name: cd0
   Mediasize: 0 (0B)
   Sectorsize: 2048
   Mode: r0w0e0
   descr: hp DVDRAM GT80N
   ident: (null)
   rotationrate: unknown
   fwsectors: 0
   fwheads: 0

Geom name: da5
Providers:
1. Name: da5
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e3
   descr: StoreJet Transcend
   lunid: 5000000000000001
   ident: X3E1SAKRS
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

Geom name: da6
Providers:
1. Name: da6
   Mediasize: 15518924800 (14G)
   Sectorsize: 512
   Mode: r1w1e3
   descr: Kingston DataTraveler 3.0
   lunname: KingstonDataTraveler 3.0
   lunid: KingstonDataTraveler 3.0
   ident: 60A44C3FACC93110B9970045
   rotationrate: 0
   fwsectors: 63
   fwheads: 255

Geom name: da7
Providers:
1. Name: da7
   Mediasize: 30943995904 (29G)
   Sectorsize: 512
   Mode: r1w1e3
   descr: Kingston DataTraveler 3.0
   ident: E0D55EA1C84FF390A9500FDA
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

Geom name: da0
Providers:
1. Name: da0
   Mediasize: 0 (0B)
   Sectorsize: 512
   Mode: r0w0e0
   descr: Generic USB SD Reader
   ident: 058F312D81B
   rotationrate: unknown
   fwsectors: 0
   fwheads: 0

Geom name: da1
Providers:
1. Name: da1
   Mediasize: 0 (0B)
   Sectorsize: 512
   Mode: r0w0e0
   descr: Generic USB CF Reader
   ident: 058F312D81B
   rotationrate: unknown
   fwsectors: 0
   fwheads: 0

Geom name: da2
Providers:
1. Name: da2
   Mediasize: 0 (0B)
   Sectorsize: 512
   Mode: r0w0e0
   descr: Generic USB SM Reader
   ident: 058F312D81B
   rotationrate: unknown
   fwsectors: 0
   fwheads: 0

Geom name: da3
Providers:
1. Name: da3
   Mediasize: 0 (0B)
   Sectorsize: 512
   Mode: r0w0e0
   descr: Generic USB MS Reader
   ident: 058F312D81B
   rotationrate: unknown
   fwsectors: 0
   fwheads: 0

Geom name: da4
Providers:
1. Name: da4
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Mode: r0w0e0
   descr: HGST HTS 725050A7E630
   lunname: JMicron USB to ATA/ATAPI bridge
   lunid: JMicron USB to ATA/ATAPI bridge
   ident: F050090681FF
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

root@mowa219-gjp4-8570p-freebsd:~ # sysctl kern.geom.debugflags=0
kern.geom.debugflags: 16 -> 0
root@mowa219-gjp4-8570p-freebsd:~ # 

Reply via email to