I have an old Excito B3 running Debian. My problem is that the hardware died. I have a device so I can connect the internal hard drive via USB to my Ubuntu laptop. But when I try to access the /home of that drive it shows up as empty. My guess is that there is a problem with user rights.

Can anyone help me with how I can get access to these files?

/media/linkan/Bubba root/home$ ll

total 8
drwxrwxrwx  2 root root 4096 jan  1  2000 ./
drwxr-xr-x 24 root root 4096 okt  5  2012 ../

sudo parted --list

[sudo] password for linkan: 
Model: ATA INTEL SSDSC2BF18 (scsi) 
Disk /dev/sda: 180GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  8200MB  8199MB  linux-swap(v1)
 2      8200MB  180GB   172GB   ext4

Model: WDC WD30 EZRX-00MMMB0 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name  Flags
 1      17,4kB  10,7GB  10,7GB  ext3            root  msftdata
 2      10,7GB  3000GB  2989GB                  home  lvm
 3      3000GB  3001GB  1074MB  linux-swap(v1)  swap

Model: SD SC32G (sd/mmc)
Disk /dev/mmcblk0: 31,9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  31,9GB  31,9GB  primary  fat32        lba

cat "/media/linkan/Bubba root/etc/fstab"

/dev/sda1   /   ext3    noatime,defaults    0   1
/dev/mapper/bubba-storage   /home   ext3    defaults        0   2
/dev/sda3   none    swap    sw          0   0
usbfs       /proc/bus/usb   usbfs   defaults    0   0
/proc       /proc   proc    defaults        0       0

sudo lvdisplay

  --- Logical volume ---
  LV Path                /dev/bubba/storage
  LV Name                storage
  VG Name                bubba
  LV UUID                M2Q0lX-y3gs-ZpP1-RwXY-QbQA-TZhP-6FltLF
  LV Write Access        read/write
  LV Creation host, time , 
  LV Status              NOT available
  LV Size                2,72 TiB
  Current LE             712580
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  • have you tried nautilus – Siva Aug 16 '18 at 22:45
  • 1
    Welcome to Unix&Linux. ;-) Could you please edit your question and post the output of parted --list and ll /media/WhereverYourHomeDirectoryIs from Ubuntu when the HDD is plugged in? – Fabby Aug 16 '18 at 22:48
  • 2
    Thanks for the edit! It sure looks like your home directory is normally mounted from a logical volume. Just to be sure, could you post the output of cat "/media/linkan/Bubba root/etc/fstab" ? – Nick ODell Aug 16 '18 at 23:09
  • 1
    apt install lvm2 && lvdisplay – user1133275 Aug 16 '18 at 23:13
  • @SivaPrasath it is the same thing regardless of using nautilus or via command line. – Linkan Aug 16 '18 at 23:22

The directory /media/linkan/Bubba root/home is empty because your old system had /home as a separate filesystem. So far, you've only mounted the root filesystem from the old disk.

Also, the old disk had the /home filesystem within a LVM logical volume, as indicated by this line in the old fstab file:

/dev/mapper/bubba-storage   /home   ext3    defaults        0   2

So, your old /home filesystem was within a LVM volume group named bubba, in a logical volume named storage. For historical reasons, there are two device paths for referring to such a logical volume: /dev/mapper/bubba-storage and /dev/bubba/storage. Both refer to the same thing.

When hot-plugging a disk that contains a LVM volume group, there is one extra step: you must activate the volume group before being able to mount any of the logical volumes within it. Run sudo vgchange -ay bubba to activate the volume group: if successful, the device /dev/mapper/bubba-storage should become available on your system. (If it fails, the error message from the vgchange command is going to be important in figuring out the problem.)

Then you can mount it anywhere you want, but perhaps it will be reasonable to mount it to its old mountpoint. First close any GUI file manager windows currently accessing the /media/linkan/Bubba root/home directory to avoid mount point is busy error messages, and do:

cd /
sudo mount /dev/mapper/bubba-storage "/media/linkan/Bubba root/home"

If you cannot access your old home directory under /media/linkan/Bubba root/home/ using your regular user account, it's probably because your account on the old system used a different UID number compared to your new system. This can be fixed easily. (I'm assuming that your current username is linkan and the username/home directory name on the old system was old_linkan. Change as appropriate.)

cd "/media/linkan/Bubba root/home"
sudo chown -R linkan: old_linkan

After the chown command completes, your old home directory should now appear as owned by you in ls -l listing, and it should be accessible as normal.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.