Linux helper: Unterschied zwischen den Versionen
Aus Vosp.info
F (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== mount external disk == '''0. connect to root and watch the results without connecting the hard disk''' <source lang="bash"> # show the connected usb devices l…“) |
F (Diskussion | Beiträge) (→copy data or better rsync the data) |
||
(5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 28: | Zeile 28: | ||
Device Boot Start End Blocks Id System | Device Boot Start End Blocks Id System | ||
− | /dev/sdb1 63 976768064 488384001 83 Linux | + | /dev/sdb1 63 976768064 488384001 83 Linux |
+ | </source> | ||
+ | |||
+ | '''3. mount the new device /dev/sdb1 for using'''' | ||
+ | <source lang="bash"> | ||
+ | # create the directory, where to mount the external harddisk | ||
+ | mkdir /media/sdb1 | ||
+ | # mount the harddisk into the directory | ||
+ | mount /dev/sdb1 /media/sdb1 | ||
+ | # show all mounted harddisk (partitions) | ||
+ | df | ||
+ | ... | ||
+ | /dev/sdb1 480587984 410963584 45188816 91% /media/sdb1 | ||
+ | </source> | ||
+ | '''4. the external harddisk is mounted in /media/sdb1 and free to use'''' | ||
+ | |||
+ | |||
+ | == copy data or better rsync the data == | ||
+ | === rsync a local directory to a local directoy === | ||
+ | '''without the --delete parameter''' | ||
+ | |||
+ | copy the directory /media/'''source''' into the directory /media/target/ ... (its means after you have /media/target/source) | ||
+ | (maybe its good to be root) | ||
+ | <source lang="bash"> | ||
+ | rsync -av --progress /media/source /media/target/ | ||
+ | </source> | ||
+ | you can repeat the order until all data are copied, it only copy after the second time the missing data | ||
+ | * [http://wiki.ubuntuusers.de/rsync wiki.ubuntuusers.de/rsync] -- german documentation | ||
+ | |||
+ | |||
+ | '''with the --delete parameter''' | ||
+ | <source lang="bash"> | ||
+ | rsync -av --progress --delete /media/source /media/target/ | ||
+ | </source> | ||
+ | the --delete parameter means, if you delete something in the source directory and you use this rsync order again, it will be also deleted in the target | ||
+ | |||
+ | === rsync a local directory to a network computer === | ||
+ | <source lang="bash"> | ||
+ | rsync -avze ssh /media/source user@example.com:/target/ | ||
</source> | </source> |
Aktuelle Version vom 23. Juli 2013, 09:19 Uhr
Inhaltsverzeichnis
mount external disk
0. connect to root and watch the results without connecting the hard disk
# show the connected usb devices
lsusb
# show the connected harddisks and list partition table(s)
fdisk -l
1. connect external disk on the computer
2. look again the results from lsusb and fdisk -l
lsusb
...
Bus 006 Device 003: ID 0123:4567 ASMedia Technology Inc. ASMedia 2105 SATA bridge
Bus 006 Device 001: ID 0123:4568 Linux Foundation 2.0 root hub
...
fdisk -l
...
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x123456
Device Boot Start End Blocks Id System
/dev/sdb1 63 976768064 488384001 83 Linux
3. mount the new device /dev/sdb1 for using'
# create the directory, where to mount the external harddisk
mkdir /media/sdb1
# mount the harddisk into the directory
mount /dev/sdb1 /media/sdb1
# show all mounted harddisk (partitions)
df
...
/dev/sdb1 480587984 410963584 45188816 91% /media/sdb1
4. the external harddisk is mounted in /media/sdb1 and free to use'
copy data or better rsync the data
rsync a local directory to a local directoy
without the --delete parameter
copy the directory /media/source into the directory /media/target/ ... (its means after you have /media/target/source) (maybe its good to be root)
rsync -av --progress /media/source /media/target/
you can repeat the order until all data are copied, it only copy after the second time the missing data
- wiki.ubuntuusers.de/rsync -- german documentation
with the --delete parameter
rsync -av --progress --delete /media/source /media/target/
the --delete parameter means, if you delete something in the source directory and you use this rsync order again, it will be also deleted in the target
rsync a local directory to a network computer
rsync -avze ssh /media/source user@example.com:/target/