I have set up a NAS on my pi but am finding the HDD is a little too small (500GB), is it possible to just swap it for a larger drive (4TB) as setting it up in the first place was for testing purposes only.
My pi is connected to an external Drive Device (made by inateck - powered from mains) so I can just pull out the old drive and insert a new one if possible.
Any advice/Help/Guidance would be appreciated.
Thanks
WD
-
- Posts: 164
- Joined: Fri Nov 30, 2018 2:39 pm
- Location: Wales
Swapping HDD for Larger Size in NAS
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. 

Re: Swapping HDD for Larger Size in NAS
am assuming you are sharing the drive via samba
plug in the new one
set it up (format the drive, set ownership, access rights, share, edit fstab)
transfer data from old drive to new drive
check again file ownership and access rights
if everything is ok
remove old hdd settings in samba, fstab
power off
remove old hdd
restart NAS
check if data in new drive is shared over the network
...have a break... have a (****)
plug in the new one
set it up (format the drive, set ownership, access rights, share, edit fstab)
transfer data from old drive to new drive
check again file ownership and access rights
if everything is ok
remove old hdd settings in samba, fstab
power off
remove old hdd
restart NAS
check if data in new drive is shared over the network
...have a break... have a (****)
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"
Re: Swapping HDD for Larger Size in NAS
Watch out for fstab entries for the old drive.
If you mount the drive using fstab and do not have the nofail option on the line, the Pi will hang if the old drive is not in when you boot.
One thing you have not said - is the operating system on the hard drive you are looking to change?
Do you want to copy any data over from the old drive?
If you mount the drive using fstab and do not have the nofail option on the line, the Pi will hang if the old drive is not in when you boot.
One thing you have not said - is the operating system on the hard drive you are looking to change?
Do you want to copy any data over from the old drive?
Re: Swapping HDD for Larger Size in NAS
why not just add the 4tb disk as additional storage?
500gb is still 500gb ) a 2nd hdd enclosure with independent power input should be a bargain on ebay etc what with 2.5" usb powered enclosures being Way more portable..
you can add 6x hdds to a Pi without issues.
500gb is still 500gb ) a 2nd hdd enclosure with independent power input should be a bargain on ebay etc what with 2.5" usb powered enclosures being Way more portable..
you can add 6x hdds to a Pi without issues.
-
- Posts: 164
- Joined: Fri Nov 30, 2018 2:39 pm
- Location: Wales
Re: Swapping HDD for Larger Size in NAS
Thanks for your replies (All)
FYI
I only have a single caddie for external drive, so just swap HDD's?
I'm not bothered about copying the images over to the new drive, so no problems there.
The Operating system is on the Pi itself.
I am the sole owner, and I log in as pi but obviously have changed the password. pi@raspberrypi:~ $ - this is my login, so ownerhip and rights will all belong to me under that login as I am the only user.
I have used windows to set up the new 4TB drive, as NTFS (as that is what properties show the old drive to be) and have named the HDD the same (CCTV) and have also created all the directories the same as what are on the old one as my CCTV cameras put the images/mpg files into those directories.
So as far as I can see the disk is identical (except size), si is it just a case of --
1. switch off the pi.
2. take out the old drive from the caddy and put in the new one.
or are there more things I need to do, as I am afraid of damaging my pi, if there are things to do in fstab, can you explain please as it's been nearly a year since I set this up but now one more camera has been added to copy images/mpg files (which come from a cam I set up in my mothers flat as she has Dementia and we want to keep an eye on her in case something happens).
Thanks
FYI
I only have a single caddie for external drive, so just swap HDD's?
I'm not bothered about copying the images over to the new drive, so no problems there.
The Operating system is on the Pi itself.
I am the sole owner, and I log in as pi but obviously have changed the password. pi@raspberrypi:~ $ - this is my login, so ownerhip and rights will all belong to me under that login as I am the only user.
I have used windows to set up the new 4TB drive, as NTFS (as that is what properties show the old drive to be) and have named the HDD the same (CCTV) and have also created all the directories the same as what are on the old one as my CCTV cameras put the images/mpg files into those directories.
So as far as I can see the disk is identical (except size), si is it just a case of --
1. switch off the pi.
2. take out the old drive from the caddy and put in the new one.
or are there more things I need to do, as I am afraid of damaging my pi, if there are things to do in fstab, can you explain please as it's been nearly a year since I set this up but now one more camera has been added to copy images/mpg files (which come from a cam I set up in my mothers flat as she has Dementia and we want to keep an eye on her in case something happens).
Thanks
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. 

Re: Swapping HDD for Larger Size in NAS
if you run
you will get output along the lines of
Each line tells the OS to mount a partition into the file system. In my case above, the partition identified by PARTUUID=e5686b27-02 is on a USB drive and is missing the nofail option. This is a bit misleading as this is the main OS for the machine but imagine that it was not, so removing this drive would stop the Pi from booting.
If you want to drop your file contents here (redact any passwords) then we can check it for you.
Code: Select all
cat /etc/fstab
Code: Select all
proc /proc proc defaults 0 0
PARTUUID=e5686b27-01 /boot vfat defaults 0 2
PARTUUID=e5686b27-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
If you want to drop your file contents here (redact any passwords) then we can check it for you.
-
- Posts: 164
- Joined: Fri Nov 30, 2018 2:39 pm
- Location: Wales
Re: Swapping HDD for Larger Size in NAS
This is the results from me entering the command 'cat /etc/fstab'
pi@raspberrypi:~ $ cat /etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
/dev/sda1 /CCTV ntfs defaults 0 0
pi@raspberrypi:~ $ cat /etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
/dev/sda1 /CCTV ntfs defaults 0 0
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. 

Re: Swapping HDD for Larger Size in NAS
here's my version of an fstab entry that I actually use on another SBC
Code: Select all
/dev/sda1 /mnt/usb ntfs permissions,noatime,rw,nofail 0 0
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"
-
- Posts: 164
- Joined: Fri Nov 30, 2018 2:39 pm
- Location: Wales
Re: Swapping HDD for Larger Size in NAS
I've tried removing the old drive from the external HDD caddie and then inserting the new one, then I powered the caddie up again and did the following:-
=========message while trying to mount drive=======================================
pi@raspberrypi:~ $ sudo blkid
/dev/mmcblk0p1: LABEL="RECOVERY" UUID="90E6-4AE3" TYPE="vfat" PARTUUID="0005231f-01"
/dev/mmcblk0p5: LABEL="SETTINGS" UUID="7ae383d9-d8c7-4cc1-844a-930d11d80aab" TYPE="ext4" PARTUUID="0005231f-05"
/dev/mmcblk0p6: LABEL="boot" UUID="03FA-9CB4" TYPE="vfat" PARTUUID="0005231f-06"
/dev/mmcblk0p7: LABEL="root" UUID="5532747b-f5d8-419e-a01e-d36acf2d334f" TYPE="ext4" PARTUUID="0005231f-07"
/dev/sda1: PARTLABEL="Microsoft reserved partition" PARTUUID="c558b709-14b8-48cc-a6fa-8b88310020fe"
/dev/mmcblk0: PTUUID="0005231f" PTTYPE="dos"
/dev/sda2: LABEL="CCTV" UUID="9E7478E77478C415" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1e7e8b12-e637-4180-a752-1c85ee6274b4"
pi@raspberrypi:~ $ sudo fdisk –l
Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
fdisk: cannot open –l: No such file or directory
pi@raspberrypi:~ $ sudo mount /dev/sda2 /mnt
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
==============================================================================
so I can see the new HDD as
/dev/sda2: LABEL="CCTV" UUID="9E7478E77478C415" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1e7e8b12-e637-4180-a752-1c85ee6274b4"
but it still will not mount?
The existing drive is:
pi@raspberrypi:~ $ sudo blkid
/dev/mmcblk0p1: LABEL="RECOVERY" UUID="90E6-4AE3" TYPE="vfat" PARTUUID="0005231f-01"
/dev/mmcblk0p5: LABEL="SETTINGS" UUID="7ae383d9-d8c7-4cc1-844a-930d11d80aab" TYPE="ext4" PARTUUID="0005231f-05"
/dev/mmcblk0p6: LABEL="boot" UUID="03FA-9CB4" TYPE="vfat" PARTUUID="0005231f-06"
/dev/mmcblk0p7: LABEL="root" UUID="5532747b-f5d8-419e-a01e-d36acf2d334f" TYPE="ext4" PARTUUID="0005231f-07"
/dev/mmcblk0: PTUUID="0005231f" PTTYPE="dos"
/dev/sda1: LABEL="CCTV" UUID="9A5877225876FBF7" TYPE="ntfs" PARTUUID="21293029-01"
=========message while trying to mount drive=======================================
pi@raspberrypi:~ $ sudo blkid
/dev/mmcblk0p1: LABEL="RECOVERY" UUID="90E6-4AE3" TYPE="vfat" PARTUUID="0005231f-01"
/dev/mmcblk0p5: LABEL="SETTINGS" UUID="7ae383d9-d8c7-4cc1-844a-930d11d80aab" TYPE="ext4" PARTUUID="0005231f-05"
/dev/mmcblk0p6: LABEL="boot" UUID="03FA-9CB4" TYPE="vfat" PARTUUID="0005231f-06"
/dev/mmcblk0p7: LABEL="root" UUID="5532747b-f5d8-419e-a01e-d36acf2d334f" TYPE="ext4" PARTUUID="0005231f-07"
/dev/sda1: PARTLABEL="Microsoft reserved partition" PARTUUID="c558b709-14b8-48cc-a6fa-8b88310020fe"
/dev/mmcblk0: PTUUID="0005231f" PTTYPE="dos"
/dev/sda2: LABEL="CCTV" UUID="9E7478E77478C415" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1e7e8b12-e637-4180-a752-1c85ee6274b4"
pi@raspberrypi:~ $ sudo fdisk –l
Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
fdisk: cannot open –l: No such file or directory
pi@raspberrypi:~ $ sudo mount /dev/sda2 /mnt
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
==============================================================================
so I can see the new HDD as
/dev/sda2: LABEL="CCTV" UUID="9E7478E77478C415" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1e7e8b12-e637-4180-a752-1c85ee6274b4"
but it still will not mount?
The existing drive is:
pi@raspberrypi:~ $ sudo blkid
/dev/mmcblk0p1: LABEL="RECOVERY" UUID="90E6-4AE3" TYPE="vfat" PARTUUID="0005231f-01"
/dev/mmcblk0p5: LABEL="SETTINGS" UUID="7ae383d9-d8c7-4cc1-844a-930d11d80aab" TYPE="ext4" PARTUUID="0005231f-05"
/dev/mmcblk0p6: LABEL="boot" UUID="03FA-9CB4" TYPE="vfat" PARTUUID="0005231f-06"
/dev/mmcblk0p7: LABEL="root" UUID="5532747b-f5d8-419e-a01e-d36acf2d334f" TYPE="ext4" PARTUUID="0005231f-07"
/dev/mmcblk0: PTUUID="0005231f" PTTYPE="dos"
/dev/sda1: LABEL="CCTV" UUID="9A5877225876FBF7" TYPE="ntfs" PARTUUID="21293029-01"
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. 

Re: Swapping HDD for Larger Size in NAS
your instruction in fstab was for /dev/sda1 only... correct?
/dev/sda2 will not mount because you have no mount instruction in fstab to mount it......
better change /dev/sda1 to /dev/sda2 in fstab
or format the hdd in Raspbian, using gparted to get just one partition on the hdd, remove that unwanted partition forced in by microsoft (in /dev/sda1)
lesson here: for any hdd/ssd/USB drive to be used in a linux system, never format it in a windows system.
/dev/sda2 will not mount because you have no mount instruction in fstab to mount it......
better change /dev/sda1 to /dev/sda2 in fstab
or format the hdd in Raspbian, using gparted to get just one partition on the hdd, remove that unwanted partition forced in by microsoft (in /dev/sda1)
lesson here: for any hdd/ssd/USB drive to be used in a linux system, never format it in a windows system.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"
Come to me with 'problems' and I'll help you find solutions"
Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"