I'm trying to transfer a working Linux installation to a new larger disk, so I've attached the new disk on a USB port, partitioned it and created filesystems.
While copying all the files over I hit a snag on the /dev directory.
"cp -a" does most of the job, but fails on e.g. /dev/video0 with "Operation not supported".
>ls -l /dev/video0 # on disk I copy from
crw-rw----+ 1 root video 81, 0 2011-09-25 17:15 video0
>ls -l dev/video0 # on disk copied to
crw-rw---- 1 root video 81, 0 2011-09-25 17:15 video0
So it seems everything was copied except for the "+" at the end of the access-rights field. What does that plus-sign mean and how can I create it on the destination disk?
Best Answer
The
+
at the end indicates the presence of an access control list. An ACL on a file gives additional users or groups specific permissions, in addition to the traditional unix permissions which only distinguish between the owning user, the owning group and others. You can usegetfacl
to see the ACL on a file andsetfacl
to set it.cp -a
would copy the ACL if it could. The reason it can't is that the target filesystem doesn't support ACLs or is mounted without ACL support.Here, this doesn't really matter.
/dev
isn't an on-disk filesystem anyway, you shouldn't copy it, and likewise you shouldn't copy/proc
,/sys
and other non-disk filesystems. Runcp -ax
to perform a copy without recursing into other filesystems.cp
is often not the best way of transfering an existing installation to a new disk. It would be easier to copy the filesystem wholesale, then enlarge it to fill the target partition. In a nutshell:where
/dev/sdy1
is the partition containing the existing installation and/dev/sdz1
is where you want to copy the system on the larger disk. Be very careful when typing this command as this will irrecoverably erase the target partition.After you've copied the files, you'll need to set up the bootloader on the new disk.
grub-install /dev/sdz
should do the trick, but you may need to write a/boot/grub/device.map
first to convey that the new disk is going to be the primary disk. If you have trouble with that, the easiest (if hardly the most convenient) way is to put the new disk in its final place, then boot from an Ubuntu CD/USB and tell the installation program to repair the bootloader.