开云体育

Reformatting a WD purple drive


 

开云体育

Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC



_._,_._,_


 

开云体育

Hi,

Just run? gparted? as root.

Cheers,

Will

On 21/09/22 04:07, raclausi wrote:

Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC



 

Reformat it using sudo gparted
If you don't already have gparted installed then sudo apt install gparted


On 20/09/2022 12:07 EDT raclausi <raclausi@...> wrote:


Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC




Nigel A. Gunn, ///shoulders.outwards.resolutions tel +1-937-971-0366
Amateur Radio G8IFF W8IFF and GMRS WRBV701, e-mail nigel@... www


 

Sudo fdisk /dev/sda. If it is /dev/sda. Use whatever device name it is assigned
Then delete the partitions 1 at a time and write to disk and exit fdisk.
Sudo fdisk /dev/sda, create a partition, set the type of partition: Linux, NTFS etc.? Write to disk and exit fdisk
Then sudo mkfs.xxxx where the xxxx is the type of file system. For Linux, use sudo mkfs.ext4 /dev/sda1 for NTFS, use mkntfs /dev/sda1



Get


David Donaldson KC30SG / WRCB627
 

I suggest you investigate GParted Live.

It's a "Live" bootable linux with GParted (Gnu Partition Editor) that you install onto a USB thumb drive.

You download and create an image on a USB drive, then boot that while your Western Digital drive is THE ONLY DISK connected to the disk controller on your PC. What I mean by this is...make sure your PC has its hard disk temporarily removed or at least disconnected.?

Why? So you don't make a mistake and accidentally delete the partition(s) on your PC.

Here's a link:


I've personally used this tool dozens of times.

Windows is, as you probably know, difficult to deal with as a tool to format disks as it tries to protect its own partitions. So I don't recommend using any Windows based partitioning applications to do this work.

You will, of course, use Windows to download this tool and to burn it onto a USB.

GParted is an excellent tool, and "should" be able to completely remove any existing partitions on the Western Digital drive. Once you clear all the partitions, you can use your raspbian OS or other Linux to partition and format the drive, or you can simply use Gparted to create a Linux partition.

You can call me if you need clarification or help with the process.

dave...

David B. Donaldson
dave@...
443-618-2454 cell
WRCB627 / KC3OSG
-------------------------------------------------------

The only good in this world is what we bring.
The only bad, is what we allow. - dbd


On Tue, Sep 20, 2022 at 10:24 PM raclausi <raclausi@...> wrote:
Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC



 

开云体育

Thank you all for your help. I hope to try this next week
Cheers,
Rich ve3DCC

rich clausi RC Software and Data

On Sep 21, 2022, at 4:56 PM, David Donaldson KC30SG / WRCB627 <dave@...> wrote:

?
I suggest you investigate GParted Live.

It's a "Live" bootable linux with GParted (Gnu Partition Editor) that you install onto a USB thumb drive.

You download and create an image on a USB drive, then boot that while your Western Digital drive is THE ONLY DISK connected to the disk controller on your PC. What I mean by this is...make sure your PC has its hard disk temporarily removed or at least disconnected.?

Why? So you don't make a mistake and accidentally delete the partition(s) on your PC.

Here's a link:


I've personally used this tool dozens of times.

Windows is, as you probably know, difficult to deal with as a tool to format disks as it tries to protect its own partitions. So I don't recommend using any Windows based partitioning applications to do this work.

You will, of course, use Windows to download this tool and to burn it onto a USB.

GParted is an excellent tool, and "should" be able to completely remove any existing partitions on the Western Digital drive. Once you clear all the partitions, you can use your raspbian OS or other Linux to partition and format the drive, or you can simply use Gparted to create a Linux partition.

You can call me if you need clarification or help with the process.

dave...

David B. Donaldson
dave@...
443-618-2454 cell
WRCB627 / KC3OSG
-------------------------------------------------------

The only good in this world is what we bring.
The only bad, is what we allow. - dbd


On Tue, Sep 20, 2022 at 10:24 PM raclausi <raclausi@...> wrote:
Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC



 

Hello Rich,

I have written a little script that you may find useful. You can see it
below, and I've attached a copy of it that can be run from a terminal.

Best regards,
Larry
Wb6BBB

=============================================================================
# show_drives.sh Display Labels and UUIDs of media
# LGD: Wed May 24 06:35:20 PDT 2017
# Re-write Fri Jun 9 04:31:03 PDT 2017
# Written as an exercise in shell script programming. LDighera@...
#

trap "setterm -foreground white;echo;exit 1" HUP 1 ERR INT QUIT TERM 15 #
trap -l will display signals (bash only)

# Put commands in the environment as positional parameters to execute
set "lsblk -f" "lsblk -a" "fdisk -l" "findmnt -A" "findmnt -D" "findmnt -D
-A" "df -Th"

# Prompt user for input
PRMPT="Enter to continue [Q]: "
WAIT(){
### ksh 'read' syntax: ksh man page line 2227 (vname?prompt) ####
[[ $(echo $SHELL |grep ksh) ]] && READ="read -n 1 REPLY?\"${PRMPT}\"" #
ksh read syntax
#### bash 'read' syntax: bash man page line 4335 (-p prompt) ####
[[ -n $BASH ]] && READ="read -n 1 -r -p \"${PRMPT}\"" #
bash read syntax (-r, no varname)
eval ${READ} #
Issue prompt for next page
[[ $REPLY != [Qq]* ]] && setterm -foreground white && return #
Return to caller
[[ $REPLY == [Qq]* ]] && setterm -foreground white #
User request to quit received
echo -e "\033[0m";exit #
Set the Xterminal foreground=black; background=white
}

# Dynamically generate header and footer lines equal to the length of the
longest line of the output of the current command with the command-name
centered in the middle of the header line
GENLIN(){
CMDLEN=$(echo "$1"|wc -m) #
The length of the current command
LEN=$(eval "$1"|wc -L) #
The length of the longest line generated by the current command passed as an
argument to this function
MIDLIN=$((( ($LEN / 2) - $(echo $1|wc -m)+2 ))) #
The mid-point of the line at which to place the current command in the
header
[[ $2 != "end" ]] && LEN=$((( $LEN - $CMDLEN ))) #
Deduct the length of the command line from the header length for footer
for i in $(seq $LEN) ;do #
Loop through the commands
echo -e "=\c" #
Print each line characters
[[ $i == $MIDLIN && $2 != "end" ]] && echo -e " $1 \c" #
Center the command-name in the header line
done
echo
}

CURROW=$(stty -a |grep rows|awk -F \; '/rows/ {print $2}'|tr -d '[a-z A-Z]')
# Get the number of terminal rows/lines (cursor row position at bottom of
screen)
[[ -n $BASH ]] && CURROW=$((( $CURROW - 1 ))) #
fucking bash :-)
while : ;do
GENLIN "$1" #
Print output header line
eval "$1" #
Print command output
GENLIN "$1" "end" #
Print output footer line
echo
shift #
Get the next command to run
[[ -z $1 ]] && { echo;exit ;} #
Exit when command list is exhausted
setterm -foreground green;WAIT;setterm -foreground white #
Color prompt for user input
echo -e "\033[0m\c" #
Set Xterminal foreground=black; background=white
tput cup $((($CURROW - 1))) 0 #
Over-write the prompt line
done
exit 0
=============================================================================

On Tue, 20 Sep 2022 12:07:02 -0400, "raclausi" <raclausi@...> wrote:

Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC


 

Thank you… I was able ,as super user, to see and change the permissions on the directories and make all readable and writable. ls -l takes a very long time to list a zillion files. I may just delete all files and use as is.
Thank you to all for valuable ideas.

Sent from my iPad rich clausi RC Software and Data

On Sep 23, 2022, at 10:32 AM, Larry Dighera <LDighera@...> wrote:

?
Hello Rich,

I have written a little script that you may find useful. You can see it
below, and I've attached a copy of it that can be run from a terminal.

Best regards,
Larry
Wb6BBB

=============================================================================
# show_drives.sh Display Labels and UUIDs of media
# LGD: Wed May 24 06:35:20 PDT 2017
# Re-write Fri Jun 9 04:31:03 PDT 2017
# Written as an exercise in shell script programming. LDighera@...
#

trap "setterm -foreground white;echo;exit 1" HUP 1 ERR INT QUIT TERM 15 #
trap -l will display signals (bash only)

# Put commands in the environment as positional parameters to execute
set "lsblk -f" "lsblk -a" "fdisk -l" "findmnt -A" "findmnt -D" "findmnt -D
-A" "df -Th"

# Prompt user for input
PRMPT="Enter to continue [Q]: "
WAIT(){
### ksh 'read' syntax: ksh man page line 2227 (vname?prompt) ####
[[ $(echo $SHELL |grep ksh) ]] && READ="read -n 1 REPLY?\"${PRMPT}\"" #
ksh read syntax
#### bash 'read' syntax: bash man page line 4335 (-p prompt) ####
[[ -n $BASH ]] && READ="read -n 1 -r -p \"${PRMPT}\"" #
bash read syntax (-r, no varname)
eval ${READ} #
Issue prompt for next page
[[ $REPLY != [Qq]* ]] && setterm -foreground white && return #
Return to caller
[[ $REPLY == [Qq]* ]] && setterm -foreground white #
User request to quit received
echo -e "\033[0m";exit #
Set the Xterminal foreground=black; background=white
}

# Dynamically generate header and footer lines equal to the length of the
longest line of the output of the current command with the command-name
centered in the middle of the header line
GENLIN(){
CMDLEN=$(echo "$1"|wc -m) #
The length of the current command
LEN=$(eval "$1"|wc -L) #
The length of the longest line generated by the current command passed as an
argument to this function
MIDLIN=$((( ($LEN / 2) - $(echo $1|wc -m)+2 ))) #
The mid-point of the line at which to place the current command in the
header
[[ $2 != "end" ]] && LEN=$((( $LEN - $CMDLEN ))) #
Deduct the length of the command line from the header length for footer
for i in $(seq $LEN) ;do #
Loop through the commands
echo -e "=\c" #
Print each line characters
[[ $i == $MIDLIN && $2 != "end" ]] && echo -e " $1 \c" #
Center the command-name in the header line
done
echo
}

CURROW=$(stty -a |grep rows|awk -F \; '/rows/ {print $2}'|tr -d '[a-z A-Z]')
# Get the number of terminal rows/lines (cursor row position at bottom of
screen)
[[ -n $BASH ]] && CURROW=$((( $CURROW - 1 ))) #
fucking bash :-)
while : ;do
GENLIN "$1" #
Print output header line
eval "$1" #
Print command output
GENLIN "$1" "end" #
Print output footer line
echo
shift #
Get the next command to run
[[ -z $1 ]] && { echo;exit ;} #
Exit when command list is exhausted
setterm -foreground green;WAIT;setterm -foreground white #
Color prompt for user input
echo -e "\033[0m\c" #
Set Xterminal foreground=black; background=white
tput cup $((($CURROW - 1))) 0 #
Over-write the prompt line
done
exit 0
=============================================================================

On Tue, 20 Sep 2022 12:07:02 -0400, "raclausi" <raclausi@...> wrote:

Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC




<show_drives.sh>


 

Have a look at the manual page for chmod: man chmod

cd <your hard drive device-name>; chmod -R 777 *

will recursively descend the directory tree.

On Fri, 23 Sep 2022 16:29:34 -0400, "raclausi" <raclausi@...> wrote:

Thank you… I was able ,as super user, to see and change the permissions on the directories and make all readable and writable. ls -l takes a very long time to list a zillion files. I may just delete all files and use as is.
Thank you to all for valuable ideas.

Sent from my iPad rich clausi RC Software and Data

On Sep 23, 2022, at 10:32 AM, Larry Dighera <LDighera@...> wrote:

?
Hello Rich,

I have written a little script that you may find useful. You can see it
below, and I've attached a copy of it that can be run from a terminal.

Best regards,
Larry
Wb6BBB

=============================================================================
# show_drives.sh Display Labels and UUIDs of media
# LGD: Wed May 24 06:35:20 PDT 2017
# Re-write Fri Jun 9 04:31:03 PDT 2017
# Written as an exercise in shell script programming. LDighera@...
#

trap "setterm -foreground white;echo;exit 1" HUP 1 ERR INT QUIT TERM 15 #
trap -l will display signals (bash only)

# Put commands in the environment as positional parameters to execute
set "lsblk -f" "lsblk -a" "fdisk -l" "findmnt -A" "findmnt -D" "findmnt -D
-A" "df -Th"

# Prompt user for input
PRMPT="Enter to continue [Q]: "
WAIT(){
### ksh 'read' syntax: ksh man page line 2227 (vname?prompt) ####
[[ $(echo $SHELL |grep ksh) ]] && READ="read -n 1 REPLY?\"${PRMPT}\"" #
ksh read syntax
#### bash 'read' syntax: bash man page line 4335 (-p prompt) ####
[[ -n $BASH ]] && READ="read -n 1 -r -p \"${PRMPT}\"" #
bash read syntax (-r, no varname)
eval ${READ} #
Issue prompt for next page
[[ $REPLY != [Qq]* ]] && setterm -foreground white && return #
Return to caller
[[ $REPLY == [Qq]* ]] && setterm -foreground white #
User request to quit received
echo -e "\033[0m";exit #
Set the Xterminal foreground=black; background=white
}

# Dynamically generate header and footer lines equal to the length of the
longest line of the output of the current command with the command-name
centered in the middle of the header line
GENLIN(){
CMDLEN=$(echo "$1"|wc -m) #
The length of the current command
LEN=$(eval "$1"|wc -L) #
The length of the longest line generated by the current command passed as an
argument to this function
MIDLIN=$((( ($LEN / 2) - $(echo $1|wc -m)+2 ))) #
The mid-point of the line at which to place the current command in the
header
[[ $2 != "end" ]] && LEN=$((( $LEN - $CMDLEN ))) #
Deduct the length of the command line from the header length for footer
for i in $(seq $LEN) ;do #
Loop through the commands
echo -e "=\c" #
Print each line characters
[[ $i == $MIDLIN && $2 != "end" ]] && echo -e " $1 \c" #
Center the command-name in the header line
done
echo
}

CURROW=$(stty -a |grep rows|awk -F \; '/rows/ {print $2}'|tr -d '[a-z A-Z]')
# Get the number of terminal rows/lines (cursor row position at bottom of
screen)
[[ -n $BASH ]] && CURROW=$((( $CURROW - 1 ))) #
fucking bash :-)
while : ;do
GENLIN "$1" #
Print output header line
eval "$1" #
Print command output
GENLIN "$1" "end" #
Print output footer line
echo
shift #
Get the next command to run
[[ -z $1 ]] && { echo;exit ;} #
Exit when command list is exhausted
setterm -foreground green;WAIT;setterm -foreground white #
Color prompt for user input
echo -e "\033[0m\c" #
Set Xterminal foreground=black; background=white
tput cup $((($CURROW - 1))) 0 #
Over-write the prompt line
done
exit 0
=============================================================================

On Tue, 20 Sep 2022 12:07:02 -0400, "raclausi" <raclausi@...> wrote:

Hi, I have acquired a “purple” (Surveillance hard drive) western digital 2 T hard drive .
I want to format it using my raspi but I do not have the permission to get beyond the cache. I would like to drop to sudo su command line but I am unsure what utilities I can call to wipe and format.
This drive was from a broken Lorex surveillance system owned by my friend who owns a hardware store. I want to repurpose it to the rasp. I am using my universal adapter kit to fire it up and read the directories but the 2020 video library is basically the whole disk. Gotta get rid of it.
Any insight is appreciated.
Rich, ve3DCC




<show_drives.sh>




 

Excellent… Thank You. I also right click on the drive and “open in terminal” to get there fast. This is a Rasp Pi 400. I was a bit hasty when I ordered it during Covid days. I missed the “I” to the right and I did not read the spec sheet. The keyboard is European, the manual is in Italian and the power supply is 240 v. Fortunately, I just needed an adapter plug since the specs say 117 to 240, I can read Italian, and a felt pen fixes the keyboard. Moral is Read the Spec sheet carefully.
The ls -l is enormous. The images are dated 2016– and are store surveillance images. The owner said go ahead and erase… so I shall. Cheers, ve3DCC

Sent from my iPad rich clausi RC Software and Data

On Sep 25, 2022, at 11:54 AM, Larry Dighera <LDighera@...> wrote:

?
Have a look at the manual page for chmod: man chmod

cd <your hard drive device-name>; chmod -R 777 *

will recursively descend the directory tree.




On Fri, 23 Sep 2022 16:29:34 -0400, "raclausi" <raclausi@...> wrote:

Thank you… I was able ,as super user, to see and change the permissions on the directories and make all readable and writable. ls -l takes a very long time to list a zillion files. I may just delete all files and use as is.
Thank you to all for valuable ideas.

Sent from my iPad rich clausi RC Software and Data

On Sep 23, 2022, at 10:32 AM, Larry Dighera <LDighera@...> wrote:
?
Hello Rich,

I have written a little script that you may find useful. You can see it
below, and I've attached a copy of it that can be run from a terminal.

Best regards,
Larry
Wb6BBB

=============================================================================
# show_drives.sh Display Labels and UUIDs of media
# LGD: Wed May 24 06:35:20 PDT 2017
# Re-write Fri Jun 9 04:31:03 PDT 2017
# Written as an exercise in shell script programming. LDighera@...
#

trap "setterm -foreground white;echo;exit 1" HUP 1 ERR INT QUIT TERM 15 #
trap -l will display signals (bash only)

# Put commands in the environment as positional parameters to execute