1

I'm creating a bootable usb as a cloned partition and am running into problems copying /proc to the usb.

I know /proc contains a lot of virtual files, but I'm not sure how to copy them over. It seems that if I use cp it doesn't treat them as virtual files. So with large virtual files like kcore it uses all the usbs disk space right away. However if I try and boot with just the folders created, it fails.

What would be the best way to copy them over and still keep them as virtual files? Or, what are the minimal files I can copy to the usb to allow it to boot?

The distro is fedora 12.

I should mention the process I'm using:

  1. create partitions on usb to match the installation you want to clone
  2. copy the files from the installation to the usb partitions
  3. install bootloader on the boot partition (grub)

Everything has gone fine so far except for copying /proc. I've done this before and haven't had this problem until now.

Nate
  • 197

2 Answers2

3

You cannot and must not copy files in /proc, or /sys. Generally speaking, you need to arrange to copy only the disk-backed files.

The files under /proc and /sys are generated by the kernel on the fly when you read them. Their contents provides information about the running system. For example, /proc/1234 is a directory where you can read information about the process with PID 1234 (if there is a running process with this PID). There is no data to copy to a disk here. For more information, read What happens when I open and read from /proc? and perhaps also deleting a 'file' under /proc or /dev.

To copy a whole filesystem under Linux, use cp -x.

1

You can't just copy an installed operating system to a usb and expect it to boot. Check out this page, which describes how to create and use Live USB.

The /proc directory contains files about system information and running processes, which you don't have to copy. They are generated by the kernel at boot time and during operation. Type "man 5 proc" into the command line to get more info.