You are not logged in.

#1 2023-07-15 01:19:05

Pyrophorus2
Member
Registered: 2023-04-11
Posts: 19

File Copying from one drive to another.

I have the journalctl output all copied to a file.

However; A couple of commands I used, seems to have copied the file over to my USB drive
When I move to this windows computer, the file is not there. I do not have internet on the affected computer.

Offline

#2 2023-07-15 02:12:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,464
Website

Re: File Copying from one drive to another.

What were these "couple of commands"?  How big is / was the journal?  Did you sync the filesystem and / or wait for a complete unmount?

EDIT: and how many partitions are on the USB?  Does windows see / mount the proper partition(s)?

Last edited by Trilby (2023-07-15 02:13:03)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-07-25 20:14:59

Pyrophorus2
Member
Registered: 2023-04-11
Posts: 19

Re: File Copying from one drive to another.

I tired with mv, cp, rsync and dd.

Results:

mv: inter-device move failed "startup.txt' to 'dev/sdc1'; unable to remove target: permission denied
cp: cannot stat '/dev/sdc1/startup.txt : Not a directory
rsync error: errors selecting input/output files, dirs (code 3) at min.c(770) [Receiver =3.2.7]

dd:
14200+1 records in
14200+1 records out
149709437 bytes (150 MB, 143 MiB) copied 4.94358 s, 30.3 MB/s

The drive is read fine on the Windows machine, but the file is not present.

Offline

#4 2023-07-25 20:47:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,120

Re: File Copying from one drive to another.

Because this is not how this works at all, https://wiki.archlinux.org/title/Mount

Offline

#5 2023-07-25 20:53:04

PavelDusek
Member
Registered: 2023-07-25
Posts: 3

Re: File Copying from one drive to another.

Have you mounted the USB drive to your filesystem before cp/mv/rsync/dd?

E.g.:

mkdir /mnt/usb-drive
mount /dev/sdc1 /mnt/usb-drive
cp startup.txt /mnt/usb-drive/
umount /dev/sdc1

Offline

#6 2023-07-25 20:54:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,464
Website

Re: File Copying from one drive to another.

Your first two failed for what should be obvious reasons (see above).  But the third one with `dd` appears to have been successful.  However, if it was successful, this would most certainly no longer be true: 

Pyrophorus2 wrote:

The drive is read fine on the Windows machine, but the file is not present.

That is with a potential exception if startup.txt was smaller than any pre-partition-table gap in which case you got very lucky or perhaps if you removed the device before the data was actually flushed to it... but if `dd` in this case was successful, it'd successfully earn it's nickname of "disk destroyer".  Be glad it wasn't and don't try using it again.

Last edited by Trilby (2023-07-25 20:55:54)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2023-07-25 20:57:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,120

Re: File Copying from one drive to another.

149709437 bytes (150 MB, 143 MiB) copied 4.94358 s, 30.3 MB/s

Whatever filesystem might have existed on sdc3 is now gone…

Offline

#8 2023-08-01 16:19:57

Pyrophorus2
Member
Registered: 2023-04-11
Posts: 19

Re: File Copying from one drive to another.

Im now getting

Cp: cannot create regular file '/mnt/usb-drive1/startup.txt' : Read-only filesystem

Chmod 777 has not worked

Offline

#9 2023-08-01 16:37:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,464
Website

Re: File Copying from one drive to another.

chmod is not relevant.  What is the filesystem?  Did you (have to) reformat after the `dd` incident?  How is the device mounted?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2023-08-01 19:17:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,120

Re: File Copying from one drive to another.

… you want to post the output of

mount

Offline

Board footer

Powered by FluxBB