NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
« Previous 1 … 27 28 29 30 31 … 34 Next »
External Disk for Recordings

 
  • 0 Vote(s) - 0 Average
External Disk for Recordings
glb1945
Offline

Junior Member

Posts: 38
Threads: 6
Joined: Sep 2015
#11
2020-03-26, 08:46 PM
Hi guys,

On windows 10 the usb drive was permanently connected and I never had to do anything
special, i.e., somehow windows must have recognized the disk before starting nextpvr. Thus I don’t understand your comment that something special has to be done in windows as that is not the case?

I am not a Linux newbie and can add startup code if need be, but I am sure others will want to use an external disk as disk storage is much cheaper than ssd storage. Why not build that possibility into the code so everyone who wants to do that does not have to add that code themselves? It is a trivial amount of code to ask if the folder is internal or external and then to check if external if the disk is mounted before proceeding? Just trying to make things easier for users.

Jerry
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,124
Threads: 957
Joined: May 2006
#12
2020-03-26, 08:54 PM
I'd love to see the trivial code you are suggesting. How can sub know what gets mounted to /media/jerry/ The folder does exist before your USB is mounted.

The drive letter order in Windows for USB drives in not guaranteed https://www.howtogeek.com/96298/assign-a...windows-7/

Martin
Ludron
Offline

Member

Posts: 83
Threads: 9
Joined: Jan 2011
#13
2020-03-26, 10:41 PM
(2020-03-21, 12:58 AM)snagglewest Wrote: Here's a good link explaining how to mount USB drives
https://help.ubuntu.com/community/Mount/USB

I'd really recommend you use an internal drive though.  If you start up the service without the USB drive powered up/mounted then NextPVR will think the recordings are deleted and remove them from the DB.  That in turn leads to some serious cussing...  DAMHIK
That would be little hard on platforms such as rPi Huh
(2020-03-26, 08:46 PM)glb1945 Wrote:  It is a trivial amount of code to ask if the folder is internal or external and then to check if external if the disk is mounted before proceeding? Just trying to make things easier for users.
What if we try to extract NPVR.zip and run it from that drive?
glb1945
Offline

Junior Member

Posts: 38
Threads: 6
Joined: Sep 2015
#14
2020-03-31, 11:23 PM
(2020-03-26, 08:54 PM)mvallevand Wrote: I'd love to see the trivial code you are suggesting.  How can sub know what gets mounted to  /media/jerry/    The folder does exist before your USB is mounted.

The drive letter order in Windows for USB drives in not guaranteed https://www.howtogeek.com/96298/assign-a...windows-7/

Martin
During setup ask if the mount point is internal or external (one line of code). The mount point is already asked for in setup.Then  whenever
starting nextpvr,  check if the disk indicated as external is mounted (one line of code). If not then mount the disk (one line of code)
glb1945
Offline

Junior Member

Posts: 38
Threads: 6
Joined: Sep 2015
#15
2020-03-31, 11:42 PM (This post was last modified: 2020-03-31, 11:44 PM by glb1945.)
Here is the code to detect if a drive is mounted and then to mount it.

Detecting USB hard drive

After you plug in your USB device to your USB port, Linux system adds a new block device into /dev/ directory. At this stage, you are not able to use this device as the USB filesystem needs to be mouted before you can retrieve or store any data. To find out what name your block device file have you can run fdisk -l command.

NOTE:fdisk command required administrative privileges to access the required information, thus from this reason the commands needs to be executed as a root user or with sudo prefix:
# fdisk -l
OR
$ sudo fdisk -l
Upon executing the above command you will get an output similar to the one below:

Disk /dev/sdc: 7.4 GiB, 7948206080 bytes, 15523840 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
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 8192 15523839 15515648 7.4G b W95 FAT32
The above output will most likely list multiple disks attached to your system. Look for your USB drive based on its size and filesystem. Once ready, take a note of the block device name of the partition you intent to mount. For example in our case that will be /dev/sdc1 with FAT32 filesystem.

##################
Note that this can be done by the user before setup

Create mount point

Before we are able to use mount command to mount the USB partition, we need to create a mount point. Mount point can be any new or existing directory within your host filesystem. Use mkdir command to create a new mount point directory where you want to mount your USB device:
# mkdir /media/usb-drive


##################
Note that this can be done by the user before setup

Mount USB Drive

At this stage we are ready to mount our USB's partition /dev/sdc1 into /media/usb-drive mount point:
# mount /dev/sdc1 /media/usb-drive/

#######################
Both of these arguments can be supplied to setup

To check whether your USB drive has been mounted correctly execute mount command again without any arguments and use grep to search for USB block device name:
# mount | grep sdc1
/dev/sdc1 on /media/usb-drive type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro
If no output has been produced by the above mount command your USB partition is not mounted. Alternatively, double-check whether you have used a correct block device name in the above command.

Accessing USB Data

If all went well, we can access our USB data simply by navigating to our previously created mount point /media/usb-drive:
# cd /media/usb-drive
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,124
Threads: 957
Joined: May 2006
#16
2020-03-31, 11:47 PM
If you think that works and will never boot with another USB drive add the line

mount /dev/sdc1 /media/jerry/

after the delay I suggested in an earlier post for PreStartup.sh

Making sure that /media/jerry has the proper permission.

Martin
glb1945
Offline

Junior Member

Posts: 38
Threads: 6
Joined: Sep 2015
#17
2020-04-01, 01:05 AM
Why not add this feature to setup as I described to make it convenient for all users wanting to do this?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#18
2020-04-01, 02:37 AM
(2020-04-01, 01:05 AM)glb1945 Wrote: Why not add this feature to setup as I described to make it convenient for all users wanting to do this?
All the application knows is the directory you have told it you want to record to. It doesn't know this is a mounted from USB drive, or what /dev it might be etc.

If some one wants to explain to me how the process would work from just having the directory name, then I'm happy to try automating something.
glb1945
Offline

Junior Member

Posts: 38
Threads: 6
Joined: Sep 2015
#19
2020-04-01, 04:13 AM
Hi sub,

If I recall, when I tried to state the directory as /media/jerry/disk/Recordings where disk was the appropriate name, the setup would not take it. Let me try tomorrow again to see if that will
or will not work by trying several options. It sems to me that once mounted linux shouldn't care if the recordings folder is on a usb drive or the ssd?

Jerry
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#20
2020-04-01, 05:25 AM
(2020-04-01, 04:13 AM)glb1945 Wrote: If I recall, when I tried to state the directory as /media/jerry/disk/Recordings  where disk was the appropriate name, the setup would not take it. 
As long as the directory existed at the time (so volume already mounted), and it had permission to access the directory, then you should have been fine. (I'm guessing the permissions bit of this may be a factor)
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): « Previous 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Direct access to recordings TugboatBill 1 318 2025-05-05, 11:04 PM
Last Post: mvallevand
  NextPVR 7 looses recordings after post processing ballfam 15 1,118 2024-12-20, 03:23 AM
Last Post: ballfam
  Recordings fail, sometimes while playing WagMan 9 766 2024-11-07, 12:46 PM
Last Post: mvallevand
  recordings fail, somtimes while playing WagMan 0 307 2024-11-02, 03:00 AM
Last Post: WagMan
  Random skipping in recordings ballfam 25 2,882 2024-04-29, 07:58 PM
Last Post: ballfam
  Failed Recordings sgar75 13 1,435 2024-04-23, 09:16 PM
Last Post: mvallevand
  failed recordings CDinger 11 1,397 2024-04-21, 03:29 AM
Last Post: CDinger
  No NVENC option in settings/transcoder and subtitles missing from ts recordings AWellesley 6 1,323 2024-03-04, 03:19 PM
Last Post: mvallevand
  upcomings recordings kfmf 9 1,227 2023-12-21, 08:48 PM
Last Post: mvallevand
  NextPVR i.mjh.nz no audio on some recordings Nzbaxterman 22 2,726 2023-12-20, 11:55 PM
Last Post: Nzbaxterman

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode