User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Keep 'losing' one of two HD's

Wed Aug 28, 2013 6:13 pm

The failed message would have been there because fstab was failing to mount a drive that didn't exist (to its knowledge)

auto mounts the drive at boot time
noatime simply stops linux from updating the timestamp whenever you access a file (i.e. with touch or when you open it), this can lead to performance increases if there is a lot of files being accessed often.

I typically just do default instead of auto and/or noatime and it works fine.

This will tell you about the two zeros at the end

http://askubuntu.com/questions/9939/wha ... fstab-mean

And the wikipedia article on fstab does a good job explaining the various flags

http://en.wikipedia.org/wiki/Fstab#Comm ... ilesystems

As opposed to expecting that you would see an immediate difference in teh way they are mounted, I was hoping that by specifying the uuid it would result in long term stability.

As a side note I'm noticing that you don't specify a filesystem type for the drives in fstab. For example: UUID=#### /mount_point FILESYSTEM_TYPE defaults 0 0
Dear forum: Play nice ;-)

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Wed Aug 28, 2013 6:22 pm

Investigate done - no help for why sda2 does not appear, however:

sudo blkid reveals:

/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="5D2D-B09A" TYPE="vfat"
/dev/mmcblk0p2: UUID="41cd5baa-7a62-4706-b8e8-02c43ccee8d9" TYPE="ext4"
/dev/sda1: LABEL="HDD1" UUID="86D8F0FED8F0ED75" TYPE="ntfs"
/dev/sdb1: LABEL="HDD2" UUID="4A7E9DD27E9DB6E3" TYPE="ntfs"

sda1 and sda1b seem logical to me so I intend to leave things as they are and see if my drives stay at home and don't go walkabouts :)

Thanks for the guidance.

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Wed Aug 28, 2013 6:52 pm

abishur wrote:The failed message would have been there because fstab was failing to mount a drive that didn't exist (to its knowledge)

auto mounts the drive at boot time
noatime simply stops linux from updating the timestamp whenever you access a file (i.e. with touch or when you open it), this can lead to performance increases if there is a lot of files being accessed often.

I typically just do default instead of auto and/or noatime and it works fine.

This will tell you about the two zeros at the end

http://askubuntu.com/questions/9939/wha ... fstab-mean

And the wikipedia article on fstab does a good job explaining the various flags

http://en.wikipedia.org/wiki/Fstab#Comm ... ilesystems

As opposed to expecting that you would see an immediate difference in teh way they are mounted, I was hoping that by specifying the uuid it would result in long term stability.

As a side note I'm noticing that you don't specify a filesystem type for the drives in fstab. For example: UUID=#### /mount_point FILESYSTEM_TYPE defaults 0 0
I had found most of what you mention in research thanks. I did see mention that using default was not a good idea for security reasons:

http://www.gentoo.org/doc/en/handbook/h ... t=1&chap=8

Although that relates to boot.

I will add the filesystem. I gathered that the changes may affect stability and certainly hope so, thanks.

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Wed Aug 28, 2013 7:58 pm

Well after all that I have lost access to the share :(

No idea why that should happen. Reverted to original fstab but still can't access the share.

I am getting an error:

mount: only root can mount /dev/sda1 on /media/HHDD1

EDIT: Found the problem: Folder HDD1 had disappeared from /media. How does a folder disappear? I thought that sort of thing only happened in winblows.

I replaced it, rebooted and all was back to normal.

itimpi
Posts: 1086
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 4:25 am

Note that your original fstab entry did NOT reference two different disks - it referenced partitions 1 and 2 on the same disk (seen as /dev/sda). In the device name format /dev/sdXN, X is different for each physical drive and N represents the partition within the physical device.

User avatar
RaTTuS
Posts: 10407
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 8:10 am

do the mount via UUID
not /dev/sd?1
that way if your Hub disconnects and re-connects the device [for what ever reason] you will get it re-attached to the same mount point
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 9:36 am

I have used:

UUID=86D8F0FED8F0ED75 /media/HDD1 ntfs noatime 0 0
UUID=4A7E9DD27E9DB6E3 /media/HDD2 ntfs noatime 0 0

Today blkid gives:

/dev/sda1: LABEL="HDD1" UUID="86D8F0FED8F0ED75" TYPE="ntfs"
/dev/sdc1: LABEL="HDD2" UUID="4A7E9DD27E9DB6E3" TYPE="ntfs"

I was unaware that in sdxn x referred to the drive

Today I have 'lost' HDD2 and needed to make a directory in /media. When I ftp'd to HDD2 it was empty. So, it would seem as said in the above post, I had 2 partitions on the same drive called HDD1 and HDD2 and was using those partitions as if they were different drives!

What a mess. What I find strange now is that when I first set this up I copied the backup files to both drives using my PC. I need to understand why HDD2 is now empty. My reasoning says it should contain the out of date files and there should be two partitions on the other drive each with current files. However, I have one set of current files on HDD1 and nothing on HDD2.

How can I be sure where I am actually looking when I ftp in to the pi using the IP address. I think I must remove the drives and connect them to my PC to be sure.

EDIT: Not sure if this makes any difference - I am not using a hub. Each drive is connected independently to one of the pi USB inputs.

User avatar
RaTTuS
Posts: 10407
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 9:41 am

sudo fdisk -l
mount
df -h
if you really want them to be ntfs I would use the ntfs-3g driver
personally I'd use the drives as ext4
dmesg
may also tell you why things are going astray
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 9:53 am

sudo fdisk -l:

Device Boot Start End Blocks Id System
/dev/sda1 63 1953521071 976760504+ 7 HPFS/NTFS/exFAT

Device Boot Start End Blocks Id System
/dev/sdc1 63 1953525167 976762552+ 7 HPFS/NTFS/exFAT

mount:
/dev/sda1 on /media/HDD1 type fuseblk (rw,nosuid,nodev,noatime,user_id=0,group_i d=0,allow_other,blksize=4096)

df -h:
Filesystem Size Used Avail Use% Mounted on
rootfs 30G 1.9G 27G 7% /
/dev/root 30G 1.9G 27G 7% /
devtmpfs 180M 0 180M 0% /dev
tmpfs 38M 720K 37M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 75M 0 75M 0% /run/shm
/dev/mmcblk0p1 56M 19M 38M 33% /boot
/dev/sda1 932G 100G 832G 11% /media/HDD1

No mention of HDD2

EDIT: I am using the ntfs-3g driver and decided to us ntfs to be able to readand write using my PC.

dmesg: http://paste.debian.net/31770/

User avatar
RaTTuS
Posts: 10407
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 10:05 am

and the useful contents of dmesg ?
sudo apt-get update
sudo apt-get install pastebinit
sudo apt-get upgrade

dmesg | pastebinit

post the url
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 10:09 am

After rebooting the files have returned to HDD2 and can be listed in file manager. However,

blkid:
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="5D2D-B09A" TYPE="vfat"
/dev/mmcblk0p2: UUID="41cd5baa-7a62-4706-b8e8-02c43ccee8d9" TYPE="ext4"
/dev/sda1: LABEL="HDD1" UUID="86D8F0FED8F0ED75" TYPE="ntfs"

No mention of the second drive this time!

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 10:13 am

Sorry, I added the dmesg output as an edit above.

dmesg: http://paste.debian.net/31770/

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 10:21 am

After the reboot:
sudo fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 63 1953521071 976760504+ 7 HPFS/NTFS/exFAT
/dev/sdb1 63 1953525167 976762552+ 7 HPFS/NTFS/exFAT

mount
/dev/sda1 on /media/HDD1 type fuseblk (rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/sdb1 on /media/HDD2 type fuseblk (rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other,blksize=4096)

df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 30G 1.9G 27G 7% /
/dev/root 30G 1.9G 27G 7% /
devtmpfs 180M 0 180M 0% /dev
tmpfs 38M 384K 38M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 75M 0 75M 0% /run/shm
/dev/mmcblk0p1 56M 19M 38M 33% /boot
/dev/sda1 932G 100G 832G 11% /media/HDD1
/dev/sdb1 932G 157G 775G 17% /media/HDD2

Reboot was necessary. Strange the usage is different.

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 11:04 am

Now I have made a share on HDD2 so I can see why the difference in usage and that is ok.

I now have better control and understand what I am doing much more. Thank you both.

User avatar
RaTTuS
Posts: 10407
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 11:07 am

if one of them vanishes then looking at dmesg may lead us to the solution
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Thu Aug 29, 2013 11:13 am

Ok, I will keep a close eye on them.

I have experience with disappearing kids lol.

micsko17
Posts: 6
Joined: Sat Aug 31, 2013 6:48 pm

Re: Keep 'losing' one of two HD's

Sat Aug 31, 2013 7:21 pm

Im having the same issue.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Keep 'losing' one of two HD's

Sat Aug 31, 2013 8:21 pm

micsko17 wrote:Im having the same issue.
The best troubleshooting tip for anyone experiencing this issue is to make sure that your hard drives are referenced by UUID and not by dev name in fstab. It's possible that the hard drives will swap dev name when attached to a usb hub (which they are, the model B has 2 ports because there is a usb hub on the board providing two usb ports and an ethernet connection) which can result in a one of the hard drives going missing.

For more information on mounting via uuid, google "fstab mount by uuid"
Dear forum: Play nice ;-)

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Sun Sep 01, 2013 11:56 am

I have 'lost' HDD1 today

Attempting to access HDD1 gives the error:

pi@raspberrypi /media $ ls -la
ls: cannot access HDD1: Transport endpoint is not connected
total 12
drwxr-xr-x 4 root root 4096 Aug 29 10:27 .
drwxr-xr-x 23 root root 4096 Aug 24 18:14 ..
d????????? ? ? ? ? ? HDD1
drwxrwxrwx 1 root root 4096 Aug 1 16:00 HDD2

Dmesg:
http://paste.debian.net/33197/

fstab:
UUID=86D8F0FED8F0ED75 /media/HDD1 ntfs noatime 0 0
UUID=4A7E9DD27E9DB6E3 /media/HDD2 ntfs noatime 0 0

The drive was accessible last evening and since then the only use was:

0 5 * * * rsync -avx --delete /media/HDD1/shares/hanprofile /media/HDD2/shares/ >> /home/pi/log/hanprofile.log 2>&1

0 6 * * * rsync -avx --delete /media/HDD1/shares/myprofile /media/HDD2/shares/ >> /home/pi/log/myprofile.log 2>&1

The first log shows a file modified time of 05:01, the second 06:00.

Suggestions welcome please.

EDIT: If I try to mkdir HDD1 I am told the file exists, so, this 'lost' HDD1 is different to the previous occasion when the directory had 'disappeared' I could remake it.

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Sun Sep 01, 2013 12:24 pm

fdisk -l:
Disk /dev/mmcblk0: 32.1 GB, 32090619904 bytes
4 heads, 16 sectors/track, 979328 cylinders, total 62676992 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c7b31

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/mmcblk0p2 122880 62676991 31277056 83 Linux

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00e98a2a

Device Boot Start End Blocks Id System
/dev/sda1 63 1953521071 976760504+ 7 HPFS/NTFS/exFAT

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0341b8c9

Device Boot Start End Blocks Id System
/dev/sdb1 63 1953525167 976762552+ 7 HPFS/NTFS/exFAT

mount:
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=183608k,nr_inodes=45902,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=38376k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=76740k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sda1 on /media/HDD1 type fuseblk (rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/sdb1 on /media/HDD2 type fuseblk (rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other,blksize=4096)

df -h:
df: `/media/HDD1': Transport endpoint is not connected
Filesystem Size Used Avail Use% Mounted on
rootfs 30G 1.9G 27G 7% /
/dev/root 30G 1.9G 27G 7% /
devtmpfs 180M 0 180M 0% /dev
tmpfs 38M 1.4M 37M 4% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 75M 0 75M 0% /run/shm
/dev/mmcblk0p1 56M 19M 38M 33% /boot
/dev/sdb1 932G 172G 760G 19% /media/HDD2

I await any suggestions before I reboot because I think a reboot will bring HDD1 back but will not fix the problem.

EDIT: The files being transferred using cronjob are 31Gb in size and there are 3 of them. I wonder if the large size caused a problem.

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Mon Sep 02, 2013 12:30 pm

Rebooted and all back to normal as expected , until the next time :(

User avatar
RaTTuS
Posts: 10407
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Keep 'losing' one of two HD's

Mon Sep 02, 2013 12:50 pm

next time do the
dmesg
before the reboot
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Mon Sep 02, 2013 12:56 pm

The dmesg was done yesterday many hours before the reboot.

User avatar
RaTTuS
Posts: 10407
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Keep 'losing' one of two HD's

Mon Sep 02, 2013 12:57 pm

well the useful part will be the bit after it has lost a HD not before
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
makem2
Posts: 231
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: Keep 'losing' one of two HD's

Mon Sep 02, 2013 1:01 pm

The 'after reboot' dmesg:

http://paste.debian.net/33712/

Return to “Troubleshooting”