LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to access files from a migrated disc? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-access-files-from-a-migrated-disc-4175434591/)

Ian D 10-29-2012 05:50 AM

How to access files from a migrated disc?
 
I am installing a new machine, but I want to copy some files from an older machine. I can access teh physical drive using a USB link, treating teh old dsik as an 'External Drive'.

When I attach the disk, it shows on the desktop as /boot, and when I open it up, I have 3 folders - efi, grub and lost+found.

If I try to open lost+found, I am told that I do not have permission to access that folder. I assume that that is where all my files are, but that nice Linux is preventing unauthoruised access. How do I access those files?

pierre2 10-29-2012 07:53 AM

Quote:

efi, grub and lost+found.
By rights, those files won't be in either grub or lost+found, as they are both system folders.
so, therefore - they should be in the efi folder . .

try installing gnome-commander in your host PC - it can be run as /root
& thus give you R/W privlidges that allow you to copy / move your stuff.

michaelk 10-29-2012 09:39 AM

lost+found is a special directory created when an ext2/3/4 file system is formatted and can only be accessed by root. In a nutshell if fsck finds corrupted files during a check it will place them in the lost+found directory. What you see is your old OS's /boot partition which was automatically mounted when the drive was attached. I assume the files you are seeking are in the / partition.

Please post your current and old linux distributions/versions and also post the old OS partition information if known. You probably have to manually mount your / partition which could be part of a LVM.

Ian D 10-29-2012 01:30 PM

The 'new' system is actually running Fedora 12. I did a 'fdisk -l' and a 'df -h /' and the results are below.
Quote:

[root@localhost ian]# fdisk -l

Disk /dev/sda: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x911a911a

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 9964 79830998+ 8e Linux LVM

Disk /dev/dm-0: 80.8 GB, 80803266560 bytes
255 heads, 63 sectors/track, 9823 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 939 MB, 939524096 bytes
255 heads, 63 sectors/track, 114 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table
[root@localhost ian]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
75G 3.4G 67G 5% /
[root@localhost ian]#
The 'old' disk is also from a Fedora 12 system - but is a 250 GB drive. It got teh default partitioning when the OS was installed. I can't just swap the drives around because the 'new' machine is PATA/IDE but the 'old disk' is SATA.

Ian D 10-30-2012 06:20 AM

I guess that my problem is this:-

When I connect my disk using a USB cable, the system automatically mounts the first partition (the /boot partition). It recognises that the disk is 250 GB, but it only sees the first partiton which is about 200MB.

I need to access the 2nd partition, so I must mount that. Obviously, I can make a folder such as /mnt/myotherdisk - but how can I know the 'address' of the drive (obviously NOT /dev/sda)?

Ian D 10-30-2012 10:52 AM

I connected the external drive via USB and it was automatically mounted by the OS. I then entered a mount command and got this output
Quote:

[root@localhost ian]# mount
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /home/ian/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ian)
/dev/sdb1 on /media/_boot type ext3 (rw,nosuid,nodev,uhelper=devkit)
I noticed that my external drive was showing as /dev/sdb1 - so I then entered the following commands
Quote:

[root@localhost ian]# mkdir /mnt/mydisk
[root@localhost ian]# mount /dev/sdb2 /mnt/mydisk/
mount: unknown filesystem type 'LVM2_member'
[root@localhost ian]#
Either I don't want to mount partition 2 OR I need to do something different to access an LVM.

michaelk 10-30-2012 12:23 PM

You need to do something different to access an LVM.
Here are the basic steps:

Scan for volume groups
vgscan -v

Once you determine the volume group set it active:
vgchange -a y Volume_Group_Name

Find the name of the Logical volume you want to mount:
lvs –all

Now mount your logical volume:
mount /dev/volume_group/logical_volume /mountpoint

Ian D 10-30-2012 01:59 PM

Thank you michaelk. That has done the trick and I am copying files.

Great.

michaelk 10-30-2012 02:16 PM

Your welcome.


All times are GMT -5. The time now is 12:08 AM.