Page 1 of 1

Want to install usb embedded with data no swap

Posted: 15 Sep 2015 10:42
by fizzgig656
I'm upgrading 9.2.0.1 to 10.2.0.2 so new installation. But I want to install it like before with embedded OS on usb with the rest of the space on the usb as a data parti on but I don't want swap. Then I can import my old raidz and carry on.
But I seem to be only able to install embedded with swap and data option 1 or just embedded option 4 only witch takes up all the usb drive.
What am I doing wrong? I must of missed something.

Re: What to install usb embedded with data no swap

Posted: 15 Sep 2015 12:54
by b0ssman
swap was introduced because in some situation the system would run out of memory and crash.

in a normal setup the swap usage should be 0.

Re: What to install usb embedded with data no swap

Posted: 15 Sep 2015 14:45
by fizzgig656
Yes. Swap was an option when I installed nas4free 9, but i could also install os with data but without swap. But I want to install 10 embedded without swap but have data partition.
I can only see the option to install os embedded with swap and data option 1. Or install os embedded only not data and no swap option 4.

Basically how can I install 10.2.0.2 embedded OS onto a usb stick and also create a 2nd partition on the same usb stick for data. I only need a little for transmission and own cloud files.

Re: What to install usb embedded with data no swap

Posted: 15 Sep 2015 17:11
by b0ssman
Install with swap then delete the partition afterwards.

Gesendet von meinem D5803 mit Tapatalk

Re: Want to install usb embedded with data no swap

Posted: 15 Sep 2015 18:12
by fizzgig656
Ok fair enough. I'll try it. Didn't need to last time. I'd of thought as it's not advised to have swap for usb due to read write burning out the drive, that installing embedded only and embedded with data would be quiet comon.
I shall try. Thankyou.

Re: Want to install usb embedded with data no swap

Posted: 15 Sep 2015 20:59
by fizzgig656
Can I not install os embedded only (no swap or data) then create a new partion for data? Is this do able from gui?

Re: Want to install usb embedded with data no swap

Posted: 16 Sep 2015 07:24
by b0ssman
you can do it manually from the command line.

but again you can do an install with swap. normally the there should be no swap usage. if there is you need more ram anyway.

Re: Want to install usb embedded with data no swap

Posted: 16 Sep 2015 13:07
by Parkcomm
If you are desperate to reclaim your swap space you can always delete the swap partition and grow the data partition - it'll take about two minutes and is explained very well in the handbook https://www.freebsd.org/doc/handbook/disks-growing.html

Re: Want to install usb embedded with data no swap

Posted: 16 Sep 2015 13:39
by fizzgig656
so to check ive done this right and to answer any other "beginners" wanting to do this (took ne a couple of hours to get it right with google by my side? i know not even novice level)
i installed OS as embedded without swap (option 4). added the disk under management, enabled SSH and connected using putty. loged in as root.

ran: gpart show
showed i had da0 with da0s1 as the os

ran: gpart add -t freebsd da0
ran: gpart create -s BSD da0s2
ran: gpart add -a4m -t freebsd-ufs da0s2
ran: newfs -U /dev/da0s2

ran: gpart show
now displays
nas4free: ~# gpart show da0
=> 63 7821249 da0 MBR (3.7G)
63 1654632 1 freebsd [active] (808M)
1654695 6166566 2 freebsd (2.9G)
7821261 51 - free - (26K)

ran: gpart show da0s2
nas4free: ~# gpart show da0s2
=> 0 6166566 da0s2 BSD (2.9G)
0 89 - free - (45K)
89 6160384 1 freebsd-ufs (2.9G)
6160473 6093 - free - (3.0M)


now i can mount the partion using
Type: Disk
Partition type: MBR
Disk: Da0
Partition:2
File System: UFS

if you create an error you can delete a partition by using "gpart delete -i 2 da0" where 2 is the partition number within da0.

Anyone able to confirm this is right or is there a better list of commands i should of done?

Re: Want to install usb embedded with data no swap

Posted: 16 Sep 2015 17:47
by Parkcomm
ran: create -s BSD da0 - should have a leading "gpart"

Re: Want to install usb embedded with data no swap

Posted: 16 Sep 2015 17:59
by fizzgig656
Oops thanks.

Re: Want to install usb embedded with data no swap

Posted: 06 Oct 2015 10:17
by fizzgig656
ok, had to rebuild and now this doest work? any help with why?
rebuilt using option 4 for cd.

setup SSH and putty'd on as root.

ran: gpart show
nas4free: ~# gpart show
=> 63 7821249 da0 MBR (3.7G)
63 1654632 1 freebsd [active] (808M)
1654695 6166617 - free - (2.9G)

ran: gpart create -s BSD da0
but get error. gpart: geom 'da0': File exists, sure i didnt get this last time, and if i try the next step "gpart add -t freebsd-ufs da0s2" i get "No such geom: da0s2."

any pointer or thoughts? what have i missed?

Re: Want to install usb embedded with data no swap

Posted: 07 Oct 2015 03:52
by Parkcomm
fizzgig656 wrote:error. gpart: geom 'da0': File exists, sure i didnt get this last time
Yep you have already created the partitioning scheme as shown in the gpart show output.
fizzgig656 wrote: if i try the next step "gpart add -t freebsd-ufs da0s2"
This has two syntax errors
  • You are adding a partition to da0 not to da0s2
    freebsd-ufs is not a valid type for the legacy MBR partitioning scheme

Code: Select all

gpart add -t freebsd da0
should work

Re: Want to install usb embedded with data no swap

Posted: 07 Oct 2015 10:43
by fizzgig656
once again thanks, now created it and get, im sure i ran gpart add -t freebsd-ufs da0 last time, unless it was something i tried and failed..

gpart show da0
=> 63 7821249 da0 MBR (3.7G)
63 1654632 1 freebsd [active] (808M)
1654695 6166566 2 freebsd (2.9G)
7821261 51 - free - (26K)

im sure im going made, as i now cant run this?
fizzgig656 wrote: ran: gpart show da0s2
=> 0 6234102 da0s2 BSD (3.0G)
0 6234102 1 freebsd-ufs (3.0G)
i get
gpart: No such geom: da0s2.

I can run gpart show da0s1 and displays details of da0s1, but i cant run it for the new partition da0s2?

im sure i ran it last time hence why i put it in my string above. thoughts please.

Re: Want to install usb embedded with data no swap

Posted: 07 Oct 2015 15:10
by Parkcomm
That has me stumped - I can see the da0s2 - its the 2.9G partition. I have no idea why its not working.

I just ran the command myself and here is the output - could provide the same (cut and paste from your term):

Code: Select all

 mightymouse: ~# gpart show da0
=>      63  30949313  da0  MBR  (15G)
        63   1654632    1  freebsd  [active]  (808M)
   1654695  29294622    2  freebsd  (14G)
  30949317        59       - free -  (30K)

 mightymouse: ~# gpart show da0s1
=>      0  1654632  da0s1  BSD  (808M)
        0     8129         - free -  (4.0M)
     8129  1638400      1  freebsd-ufs  (800M)
  1646529     8103         - free -  (4.0M)

 mightymouse: ~# gpart show da0s2
=>       0  29294622  da0s2  BSD  (14G)
         0  29294622         - free -  (14G)

Re: Want to install usb embedded with data no swap

Posted: 07 Oct 2015 16:17
by fizzgig656
ok, logged in as root.

ltbowers: ~# gpart show da0
=> 63 7821249 da0 MBR (3.7G)
63 1654632 1 freebsd [active] (808M)
1654695 6166566 2 freebsd (2.9G)
7821261 51 - free - (26K)

ltbowers: ~# gpart show da0s1
=> 0 1654632 da0s1 BSD (808M)
0 8129 - free - (4.0M)
8129 1638400 1 freebsd-ufs (800M)
1646529 8103 - free - (4.0M)

ltbowers: ~# gpart show da0s2
gpart: No such geom: da0s2.

Re: Want to install usb embedded with data no swap

Posted: 07 Oct 2015 17:56
by Parkcomm
It's right there!!! Gaaah!

maybe try

Code: Select all

geom part list da0
Also try destroying and recreate. And try running the newfs command and see if that works.

Code: Select all

gpart delete -i 2 da0
gpart add -t freebsd da0
newfs -U /dev/da0s2
geom part list da0
Copy the output here (can you tell I'm running out of ideas?)

Re: Want to install usb embedded with data no swap

Posted: 08 Oct 2015 09:44
by fizzgig656
from your first suggestion

Code: Select all

ltbowers: ~# geom part list da0
Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 7821311
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: da0s1
   Mediasize: 847171584 (808M)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 32256
   Mode: r1w0e0
   attrib: active
   rawtype: 165
   length: 847171584
   offset: 32256
   type: freebsd
   index: 1
   end: 1654694
   start: 63
2. Name: da0s2
   Mediasize: 3157281792 (2.9G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 847203840
   Mode: r0w0e0
   rawtype: 165
   length: 3157281792
   offset: 847203840
   type: freebsd
   index: 2
   end: 7821260
   start: 1654695
Consumers:
1. Name: da0
   Mediasize: 4004511744 (3.7G)
   Sectorsize: 512
   Mode: r1w0e0

Re: Want to install usb embedded with data no swap

Posted: 08 Oct 2015 09:47
by fizzgig656
and the 2nd option. still didnt work. shall i thry a new install? or try a install with swap then reinstall with just option 4?

can i complete delete the usb or will a new install do that.

Code: Select all

 ltbowers: ~# gpart delete -i 2 da0
da0s2 deleted
 ltbowers: ~# gpart add -t freebsd da0
da0s2 added
 ltbowers: ~# newfs -U /dev/da0s2
/dev/da0s2: 3011.0MB (6166560 sectors) block size 32768, fragment size 4096
        using 5 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.
        with soft updates
super-block backups (for fsck_ffs -b #) at:
 192, 1282432, 2564672, 3846912, 5129152
 ltbowers: ~# geom part list da0
Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 7821311
first: 63
entries: 4
scheme: MBR
Providers:
1. Name: da0s1
   Mediasize: 847171584 (808M)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 32256
   Mode: r1w0e0
   attrib: active
   rawtype: 165
   length: 847171584
   offset: 32256
   type: freebsd
   index: 1
   end: 1654694
   start: 63
2. Name: da0s2
   Mediasize: 3157281792 (2.9G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 847203840
   Mode: r0w0e0
   rawtype: 165
   length: 3157281792
   offset: 847203840
   type: freebsd
   index: 2
   end: 7821260
   start: 1654695
Consumers:
1. Name: da0
   Mediasize: 4004511744 (3.7G)
   Sectorsize: 512
   Mode: r1w0e0

 ltbowers: ~# gpart show da0s2
gpart: No such geom: da0s2.
 ltbowers: ~# gpart show da0s1
=>      0  1654632  da0s1  BSD  (808M)
        0     8129         - free -  (4.0M)
     8129  1638400      1  freebsd-ufs  (800M)
  1646529     8103         - free -  (4.0M)

Re: Want to install usb embedded with data no swap

Posted: 08 Oct 2015 10:22
by Parkcomm
OK this is weird - but what is happening is the partition (slice) gets created and the filesystem gets created - its all working.

gpart show is the only problem but that doesn't matter.

So you can mouth that file system now using the mount command. You need to create a directory first.

Code: Select all

mkdir /mnt/mymountpoint
mount /dev/da0s2 /mnt/mymountpoint
and bobs your uncle

Re: Want to install usb embedded with data no swap

Posted: 08 Oct 2015 11:01
by fizzgig656
ok thanks, weird gpart show da0s2 doesnt work?

Re: Want to install usb embedded with data no swap

Posted: 08 Oct 2015 12:20
by Parkcomm
Never seen it before - probably someone on this forum knows what causes it.

Re: Want to install usb embedded with data no swap

Posted: 08 Oct 2015 13:15
by fizzgig656
Im at a point were i could rebuild, is it worth trying for sake of testing?

Re: Want to install usb embedded with data no swap

Posted: 08 Oct 2015 14:21
by armandh
yes I know that N4F has grown past its humble beginnings.
back then, when memory was short, it just slowed down.
back then swap was an option, now it seems more of a crash prevention necessity!
so, rather than leave my newest on a USB stick, I moved it to an old/small 64 Gb SSD from the spare parts box.

even if seldom used, swap on a USB stick has to be the slowest memory since 1 Mb SIMM

Re: Want to install usb embedded with data no swap

Posted: 09 Oct 2015 03:55
by Parkcomm
I'm not sure what you mean by rebuild - I thought you have installed Nas4Free on da0S1 and da0s2 is now available as a data partition. You can probably go to Disk|Management import the disk Disk|Mount and mount it.

Import your Raidz

The build a small zvol on that - and go to System|Advanced|Swap and select dev/zvol/yourZvolName

Re: Want to install usb embedded with data no swap

Posted: 09 Oct 2015 09:28
by fizzgig656
Parkcomm wrote:I'm not sure what you mean by rebuild - I thought you have installed Nas4Free on da0S1 and da0s2 is now available as a data partition. You can probably go to Disk|Management import the disk Disk|Mount and mount it.

Import your Raidz

The build a small zvol on that - and go to System|Advanced|Swap and select dev/zvol/yourZvolName
I mean do i re-install N4F and try creating the partition again to see why "gpart show da0s2" worked the first time i built it but not on the latest build? i know its a bit of a drastic approach and i have created and mounted the 2nd partition but its not real hardship to do. It does annoy me when i get concisenesses.

Re: Want to install usb embedded with data no swap

Posted: 20 Oct 2015 11:19
by fizzgig656
well ive had to start again following another issue( on another post) so deleted partitions, and still got the above error. install OS option 4, ran SSH and run the above.

Code: Select all

 nas4free: ~# gpart show da0
=>     63  7821249  da0  MBR  (3.7G)
       63  1654632    1  freebsd  [active]  (808M)
  1654695  6166617       - free -  (2.9G)

 nas4free: ~# gpart add -t freebsd  da0
da0s2 added
 nas4free: ~# newfs -U /dev/da0s2
/dev/da0s2: 3011.0MB (6166560 sectors) block size 32768, fragment size 4096
        using 5 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.
        with soft updates
super-block backups (for fsck_ffs -b #) at:
 192, 1282432, 2564672, 3846912, 5129152
 nas4free: ~# gpart show
=>     63  7821249  da0  MBR  (3.7G)
       63  1654632    1  freebsd  [active]  (808M)
  1654695  6166566    2  freebsd  (2.9G)
  7821261       51       - free -  (26K)
 
  nas4free: ~# gpart show da0s2
gpart: No such geom: da0s2.
Any thought. do i formate the USB in windows or something to completely wipe the drive and start again? why does this one refuse to display da0s2?

Re: Want to install usb embedded with data no swap

Posted: 20 Oct 2015 12:58
by Parkcomm
I'm getting the same behaviour - I don't worry about it, it works

Re: Want to install usb embedded with data no swap

Posted: 20 Oct 2015 14:17
by daoyama
fizzgig656 wrote: nas4free: ~# gpart show da0s2
gpart: No such geom: da0s2.

Any thought. do i formate the USB in windows or something to completely wipe the drive and start again? why does this one refuse to display da0s2?
This is normal if you didn't create partition on da0s2.
Correct and recommend way is:

# gpart add -t freebsd da0
# gpart create -s BSD da0s2
# gpart add -a4m -t freebsd-ufs da0s2
# newfs -U /dev/da0s2a


However, if you don't want manual tuning after using, I strongly recommend to keep swap partition.
The default swap area is also used for firmware upgrading as temporary storage.
So you must adjust memory usage not to exceed 1 byte.
If you don't have swap, you may need rebooting NAS4Free before upgrading to flush used memory.

Note: if you set your own swap on HDD, the default swap is never used(attached).

Re: Want to install usb embedded with data no swap

Posted: 20 Oct 2015 19:48
by fizzgig656
cheers, some of that sound familiar, as you can tell im not used to doing this much, but do understand it as i go. ive updated my comment higher up so its "correct" as it were. both seem to work fine, but i must of done that last time but forgot the "odd" step. :)