TiVoCommunity.com
(c)opyright 1995-2005 All rights reserved
indexcheckTC
This area is a static history of posts in the TiVo Community Forum Archive.
This archive history was made for the simple indexing of search sites like
Google.
Pages:1
Linux Command question
(Click here to view the original thread with full colors/images)
Posted by: llogan
What would the command line look like if I wanted to copy a file from a CD-ROM drive to a hard drive?
cp and then what?
This should be easy, I know, long day.
Posted by: Robert S
You are thinking Windows, young one. You must let go of the old ways and learn to think Unix. Only then can you copy the file.
Unix has a unified directory structure, the bottom is / (prn: 'root'), not a device letter. To access files on devices other than the root partition, you must mount the partition onto an existing directory. The mounting process replaces the mount point with the filing system contained in the mounted partition. Let's look at Hinsdale's instruction for mounting the backup drive:
mkdir /mnt/dos
Here we create a mount point for the new partition. Partitions don't have to be mounted in /mnt, but it's a convenient place to put mount points. We could just mount on /mnt itself, or create a mount point in root, or use any other existing directory. Beware, though, any files or directories in the directory we're using as a mount point will be inaccessible while the partition is mounted (although open files will not be closed by doing this).
mount /dev/hda1 /mnt/dos
Performs the actual mount. If there's no error message, then the command succeeded. Linux is able to detect most of the filesystems you're likely to need.
ls /mnt/dos
Now gives us the same list of files that DIR C:\ would have given if we were in DOS.
Similarly we need to mount the ISO 9660 filing system on the CD.
mkdir /mnt/cd
mount /dev/hdd /mnt/cd
This may not work from a TiVo boot disk because hdd is byteswapped, but it should work from MFS Tools 2.0 or Tom's Root and Boot Disk. You can boot MFS Tools 2.0 with the magic incantation from the Fixes thread to byteswap only your TiVo drive. You might also need to specify the filing system:
mount -t iso9660 /dev/hdd /mnt/cd
You'll notice that CD's aren't partitioned - no number in the device node.
Now we can copy the file:
cp /mnt/cd/tivo.bak /mnt/dos/HDR_2.5.bak
Although mounting is a pain, it does allow us to communicate more clearly to the operating system. If you press Eject on the CD, nothing will happen. The OS knows it's in use. So we need to give up our mount:
umount /mnt/cd
And now we can eject the CD.
It's a good idea to unmount the hard drive before you reboot. Generally you should not reboot or switch off a Unix system with filing system mounted - use umount to drop any partitions you've been working on.
Boot disks run from RAM-based disks, so there's no need to unmount them before you pull the plug. A 'proper' Unix installation running from a hard drive should be shutdown with shutdown, which ensures all devices are safely unmounted before closing down.
Posted by: llogan
Kept you busy today, haven't I.... :D
vBulletin Copyright ©2000 - 2009,
Jelsoft Enterprises Limited.
vB Easy Archive Final ©2000 - 2009
- Created by Stefan "Xenon" Kaeser
Modified by Adam J. de Jaray