mount /unmount
Hi, I have 3 question is FreeBSD can boot and run all service while one of slice is not mount for example /usr slice.. and second question is my mysql is in /var slice if /var is not mout can I access mysql being root and chek all databases also can read log file on /var third question is can I mount any unmount slice by using just fsck :) thx -- Share now a pigeon's flight Bluebound along the ancient skies, Its women forever hair and mammal, A Mediterranean town may arise If you rip apart a pigeon's heart. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: mount /unmount
On Mon, 4 Jul 2011 15:28:16 +0300, tethys ocean wrote: Hi, I have 3 question is FreeBSD can boot and run all service while one of slice is not mount for example /usr slice.. Check the corresponding entry in /etc/fstab where all file systems should be mentioned that you want to be mounted at system startup. For example, a proper line would look like this: # DeviceMountpoint FStype Options DumpPass# # --- - -- - - - /dev/ad0s1f /usrufs rw 2 2 Check device names. Depending on how you're accessing disks, the name could also be ad0f, ada0f, da0f or something else. Also keep the correct terminology: FreeBSD mounts UFS partitions, not slices. A slice contains a partition carrying a file system, usually UFS. and second question is my mysql is in /var slice if /var is not mout can I access mysql being root and chek all databases also can read log file on /var No. You can't access files inside a file system that isn't mounted (exceptions: forensic analysis, or performing a device dump). third question is can I mount any unmount slice by using just fsck :) No. You can only mount file system that are marked clean. To accomplish this - yes - running fsck for the device (or the mount point, if listed in /etc/fstab) is required when the device has been uncleanly mounted previously. To mount all file systems, use mount -a. Also you should _not_ fsck a mounted partition. Unmount them first (if required), run fsck, then mount. In worst case, boot from a live system CD or DVD or USB stick and issue the fsck command from there (really, just worst case scenario, you shouldn't need this in the first place). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: mount /unmount
On 04/07/2011 13:28, tethys ocean wrote: is FreeBSD can boot and run all service while one of slice is not mount for example /usr slice.. You can't run a program unless the partition containing it is mounted. Neither can you run a program if any command interpreter (eg. perl, php, bash) it uses, or any shared library is similarly not on a mounted partition. In order to facilitate working in single user mode, where just about every partition except the root is usually unmounted, there is a selection of useful applications in /rescue -- these are statically linked so no problems with unavailable shlibs. and second question is my mysql is in /var slice if /var is not mout can I access mysql being root and chek all databases also can read log file on /var MySQL's default data directory location is /var/db/mysql on FreeBSD. No, you need to mount /var to verify the information you require. third question is can I mount any unmount slice by using just fsck :) If a partition was not unmounted cleanly (eg. the machine crashed, or the power was cut off suddenly) then fsck(8) should be used to check and fix any problems on the filesystem. If you've booted into single-user mode, then definitely fsck any partitions before trying to mount them. However, any fsck'ing that the system requires should happen automatically if you just let the system reboot itself. It's only occasionally when there are certain problems that fsck needs human input to resolve that you will be instructed to get onto the console and run fsck by hand[*]. Generally you'ld then use mount(8) to mount any partitions. Cheers, Matthew [*] This is dependent on what sort of filesystems you are using. For instance, ZFS never needs to stop and fsck in this way. UFS+Journal won't need it either[+]. [+] Sysinstall doesn't support installing a system using these filesystem technologies: it can be done manually, but that isn't for the faint of heart. -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matt...@infracaninophile.co.uk Kent, CT11 9PW signature.asc Description: OpenPGP digital signature
Re: mount /unmount
Hello, You seem to be new to FreeBSD. In that case , I would recommend you to read the Handbook. It is very very good documentation. On 04-Jul-2011, at 5:58 PM, tethys ocean wrote: Hi, I have 3 question is FreeBSD can boot and run all service while one of slice is not mount for example /usr slice.. Yes, FreeBSD can run off a single filesystem. and second question is my mysql is in /var slice if /var is not mout can I access mysql being root and chek all databases also can read log file on /var If /var is on separate filesystem, then there is no way you can access anything inside /var without mounting /var first. third question is can I mount any unmount slice by using just fsck :) fsck is a utility which is used to check filesystem for consistency. For mounting a filesystem you should be using /sbin/mount and for unmounting you should use /sbin/unmount. Thanks Subhro
Re: mount /unmount
so thx :) I have a question again in below On Mon, Jul 4, 2011 at 4:15 PM, Polytropon free...@edvax.de wrote: On Mon, 4 Jul 2011 15:28:16 +0300, tethys ocean wrote: Hi, I have 3 question is FreeBSD can boot and run all service while one of slice is not mount for example /usr slice.. Check the corresponding entry in /etc/fstab where all file systems should be mentioned that you want to be mounted at system startup. For example, a proper line would look like this: # DeviceMountpoint FStype Options Dump Pass# # --- - -- - - - /dev/ad0s1f /usrufs rw 2 2 Check device names. Depending on how you're accessing disks, the name could also be ad0f, ada0f, da0f or something else. * Also keep the correct terminology: FreeBSD mounts UFS partitions, not slices. A slice contains a partition carrying a file system, usually UFS.* *Means that /usr is not slice ?? or /var is not slice? are all these are UFS ?* and second question is my mysql is in /var slice if /var is not mout can I access mysql being root and chek all databases also can read log file on /var No. You can't access files inside a file system that isn't mounted (exceptions: forensic analysis, or performing a device dump). third question is can I mount any unmount slice by using just fsck :) No. You can only mount file system that are marked clean. To accomplish this - yes - running fsck for the device (or the mount point, if listed in /etc/fstab) is required when the device has been uncleanly mounted previously. To mount all file systems, use mount -a. Also you should _not_ fsck a mounted partition. Unmount them first (if required), run fsck, then mount. In worst case, boot from a live system CD or DVD or USB stick and issue the fsck command from there (really, just worst case scenario, you shouldn't need this in the first place). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... -- Share now a pigeon's flight Bluebound along the ancient skies, Its women forever hair and mammal, A Mediterranean town may arise If you rip apart a pigeon's heart. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: mount /unmount
so so thx :) On Mon, Jul 4, 2011 at 4:30 PM, Matthew Seaman m.sea...@infracaninophile.co.uk wrote: On 04/07/2011 13:28, tethys ocean wrote: is FreeBSD can boot and run all service while one of slice is not mount for example /usr slice.. You can't run a program unless the partition containing it is mounted. Neither can you run a program if any command interpreter (eg. perl, php, bash) it uses, or any shared library is similarly not on a mounted partition. In order to facilitate working in single user mode, where just about every partition except the root is usually unmounted, there is a selection of useful applications in /rescue -- these are statically linked so no problems with unavailable shlibs. and second question is my mysql is in /var slice if /var is not mout can I access mysql being root and chek all databases also can read log file on /var MySQL's default data directory location is /var/db/mysql on FreeBSD. No, you need to mount /var to verify the information you require. third question is can I mount any unmount slice by using just fsck :) If a partition was not unmounted cleanly (eg. the machine crashed, or the power was cut off suddenly) then fsck(8) should be used to check and fix any problems on the filesystem. If you've booted into single-user mode, then definitely fsck any partitions before trying to mount them. *I guess If I can do fsck without unmount partition I can lost all my data isn't it?* However, any fsck'ing that the system requires should happen automatically if you just let the system reboot itself. It's only occasionally when there are certain problems that fsck needs human input to resolve that you will be instructed to get onto the console and run fsck by hand[*]. Generally you'ld then use mount(8) to mount any partitions. Cheers, Matthew [*] This is dependent on what sort of filesystems you are using. For instance, ZFS never needs to stop and fsck in this way. UFS+Journal won't need it either[+]. [+] Sysinstall doesn't support installing a system using these filesystem technologies: it can be done manually, but that isn't for the faint of heart. -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matt...@infracaninophile.co.uk Kent, CT11 9PW -- Share now a pigeon's flight Bluebound along the ancient skies, Its women forever hair and mammal, A Mediterranean town may arise If you rip apart a pigeon's heart. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: mount /unmount
On 04/07/2011 15:50, tethys ocean wrote: * Also keep the correct terminology: FreeBSD mounts UFS partitions, not slices. A slice contains a partition carrying a file system, usually UFS.* *Means that /usr is not slice ?? or /var is not slice? are all these are UFS ?* It's just nomenclature. To look like a cool and savvy FreeBSD user, talk about /partitions/ rather than /slices/. UFS is the 'Unix File System' -- it describes the way the data are formatted and managed on the disk. As opposed to, eg. ext3 (Linux) or NTFS (Windows). Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matt...@infracaninophile.co.uk Kent, CT11 9PW signature.asc Description: OpenPGP digital signature
Re: mount /unmount
On Mon, 4 Jul 2011 17:50:36 +0300, tethys ocean wrote: *Means that /usr is not slice ?? or /var is not slice? are all these are UFS ?* In traditional FreeBSD disk partitioning, a disk can hold 4 slices. In MICROS~1 land, those are called DOS primary partitions. Unlike there, FreeBSD usually just needs one slice to install into. The FreeBSD slice is divided into partitions. Each partition carries a UFS file system - except the swap partition. Those partitions are then mounted. This means that in default installs /usr and /var are the mountpoints of the corresponding partitions (to be fully correct in terminology) that have a UFS file system. Example: ad0 = the 1st DISK ad0s1 = the 1st SLICE on the 1st disk ad0s1a = the 1st PARTITION on the 1st slice on the 1st disk, formatted with UFS Each partition is assigned a mountpoint. This is the connection used by the mount command: It mounts the device specifying a partition to the given mountpoint directory. A common method of partitioning is this: # DeviceMountpoint FStype Options DumpPass# # --- -- -- - - - /dev/ad0s1b noneswapsw 0 0 /dev/ad0s1a / ufs rw 1 1 /dev/ad0s1d /tmpufs rw 2 2 /dev/ad0s1e /varufs rw 2 2 /dev/ad0s1f /usrufs rw 2 2 /dev/ad0s1g /home ufs rw 2 2 (In the _default_ install, /home is symlinked to /usr/home which means it's not a separate partition.) However, it's possible to just create one partition and install all the system's functional parts into that one partition. Mounting it will give access to all subtrees. Basically, my comment was about the correct terminology which is important to use in order to avoid misinterpretations. There is also a mechanism called dedicated partitioning; it's the same as above, just omitting the slicing part, i. e. partitions are created directly on the disk (ad0a, ad0d, ad0e, ad0f and so on). Other partitioning mechanisms do also exist, like GPT (using gpart instead of traditional MBR tools fdisk + bsdlabel), here partition names are ad0p1, ad0p2 and so on. It's also possible to identify partition devices with labels instead of bare numbers, this can be done by labeling them. And of course there's ZFS. :-) You can find more information in the FreeBSD handbook. 3.5 Disk Organization http://www.freebsd.org/doc/handbook/disk-organization.html 18.3 Adding Disks http://www.freebsd.org/doc/handbook/disks-adding.html 19.6 Labeling Disk Devices http://www.freebsd.org/doc/handbook/geom-glabel.html -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: mount /unmount
On 04/07/2011 15:53, tethys ocean wrote: If a partition was not unmounted cleanly (eg. the machine crashed, or the power was cut off suddenly) then fsck(8) should be used to check and fix any problems on the filesystem. If you've booted into single-user mode, then definitely fsck any partitions before trying to mount them. *I guess If I can do fsck without unmount partition I can lost all my data isn't it?* fsck on an unmounted partition will change on-disk data structures in ways that the kernel doesn't expect. So, yes, one consequence is that you can lose or corrupt data. You probably wouldn't lose everything in the partition -- but you would tend to cause corruption predominantly in files that are more actively used. So don't do that. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matt...@infracaninophile.co.uk Kent, CT11 9PW signature.asc Description: OpenPGP digital signature
Re: mount /unmount
Quoth Matthew Seaman on Monday, 04 July 2011: On 04/07/2011 15:53, tethys ocean wrote: If a partition was not unmounted cleanly (eg. the machine crashed, or the power was cut off suddenly) then fsck(8) should be used to check and fix any problems on the filesystem. If you've booted into single-user mode, then definitely fsck any partitions before trying to mount them. *I guess If I can do fsck without unmount partition I can lost all my data isn't it?* fsck on an unmounted partition will change on-disk data structures in ways that the kernel doesn't expect. So, yes, one consequence is that you can lose or corrupt data. You probably wouldn't lose everything in the partition -- but you would tend to cause corruption predominantly in files that are more actively used. So don't do that. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matt...@infracaninophile.co.uk Kent, CT11 9PW I presume you meant to say on a mounted partition...? -- .O. | Sterling (Chip) Camden | http://camdensoftware.com ..O | sterl...@camdensoftware.com | http://chipsquips.com OOO | 2048R/D6DBAF91 | http://chipstips.com pgpN6Qlmkf89J.pgp Description: PGP signature
Re: mount /unmount
On 04/07/2011 20:59, Chip Camden wrote: I presume you meant to say on a mounted partition...? Yep. Glad to see you're all alert. Carry on now, nothing to see here... Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matt...@infracaninophile.co.uk Kent, CT11 9PW signature.asc Description: OpenPGP digital signature
Re: mount /unmount
In freebsd-questions Digest, Vol 370, Issue 2, Message: 19 On Mon, 04 Jul 2011 20:43:23 +0100 Matthew Seaman m.sea...@infracaninophile.co.uk wrote: On 04/07/2011 15:53, tethys ocean wrote: If a partition was not unmounted cleanly (eg. the machine crashed, or the power was cut off suddenly) then fsck(8) should be used to check and fix any problems on the filesystem. If you've booted into single-user mode, then definitely fsck any partitions before trying to mount them. *I guess If I can do fsck without unmount partition I can lost all my data isn't it?* fsck on an unmounted partition will change on-disk data structures in ways that the kernel doesn't expect. So, yes, one consequence is that you can lose or corrupt data. You probably wouldn't lose everything in the partition -- but you would tend to cause corruption predominantly in files that are more actively used. So don't do that. Actually fsck is smarter than to damage data on mounted partitions; it forces the -n switch (NO WRITE) on a mounted partition so is perfectly safe to use, as long as you're aware that it can't correct any errors, and indeed will most often list some apparent errors that are merely temporary inconsistencies in the present state of the filesystem such as open files, viz: sola# mount -p /dev/ad0s2a / ufs rw 1 1 devfs /devdevfs rw0 0 /dev/ad0s2d /varufs rw,noatime 2 2 /dev/ad0s2e /usrufs rw,noatime 2 2 devfs /var/named/dev devfs rw0 0 sola# fsck /var ** /dev/ad0s2d (NO WRITE) ** Last Mounted on /var ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts UNREF FILE I=24 OWNER=mysql MODE=100600 SIZE=0 MTIME=Feb 6 23:59 2011 CLEAR? no UNREF FILE I=60 OWNER=mysql MODE=100600 SIZE=0 MTIME=Feb 6 23:59 2011 CLEAR? no UNREF FILE I=86 OWNER=mysql MODE=100600 SIZE=0 MTIME=Feb 6 23:59 2011 CLEAR? no UNREF FILE I=24830 OWNER=root MODE=140666 SIZE=0 MTIME=Mar 2 03:32 2011 CLEAR? no ** Phase 5 - Check Cyl groups 2579 files, 96883 used, 29956 free (1132 frags, 3603 blocks, 0.9% fragmentation) sola# fsck /usr ** /dev/ad0s2e (NO WRITE) ** Last Mounted on /usr ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts UNREF FILE I=804237 OWNER=smithi MODE=100640 SIZE=0 MTIME=Jun 29 20:29 2011 CLEAR? no ** Phase 5 - Check Cyl groups 401132 files, 8584016 used, 3155190 free (88926 frags, 383283 blocks, 0.8% fragmentation) cheers, Ian ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Auto mount/unmount USB hard drive
On Tue, 2006-05-09 at 02:00 +0200, Joerg Pernfuss wrote: On Mon, 08 May 2006 19:40:44 -0400 Robert Fitzpatrick [EMAIL PROTECTED] wrote: I have a USB hard drive mounting and working fine. I have the following entry in /etc/fstab that allows it to work on boot. The device loads as /dev/da4. But if I disconnect without unmounting the device, it detaches, but when plugged back in, it receives a new device as /dev/da5, which is not what is in fstab of course, yada, yada, yada. Is there a way I can get it to automatically mount/unmount the drive while working under the same device id as I unplug and plug back in? /dev/da4s1 /mnt/usbmsdos rw,noauto 0 0 If the msdosfs has a label, you could load geom_label.ko and use sth like /dev/msdosfs/usbdisk /mnt/usbmsdos rw,noauto 0 0 Sorry for the direct message Joerg, I am resending this to the list. Thanks, but how do I label the msdosfs? I assume something similar to tunefs for UFS, but I don't see a label option for msdosfs. -- Robert ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Auto mount/unmount USB hard drive
On Tue, 09 May 2006 09:12:12 -0400 Robert Fitzpatrick [EMAIL PROTECTED] wrote: On Tue, 2006-05-09 at 02:00 +0200, Joerg Pernfuss wrote: If the msdosfs has a label, you could load geom_label.ko and use sth like /dev/msdosfs/usbdisk/mnt/usbmsdos rw,noauto 0 0 Sorry for the direct message Joerg, I am resending this to the list. np. Thanks, but how do I label the msdosfs? I assume something similar to tunefs for UFS, but I don't see a label option for msdosfs. In newfs_msdos(8) it is the -I volume id option. Maybe there is some tool available via ports that can change the volid of an already existing msdosfs, the FreeBSD base doesn't contain one as far as I know. Jörg -- | /\ ASCII ribbon | GnuPG Key ID | e86d b753 3deb e749 6c3a | | \ / campaign against |0xbbcaad24 | 5706 1f7d 6cfd bbca ad24 | | XHTML in email |.the next sentence is true. | | / \ and news | .the previous sentence was a lie.| signature.asc Description: PGP signature
Auto mount/unmount USB hard drive
I have a USB hard drive mounting and working fine. I have the following entry in /etc/fstab that allows it to work on boot. The device loads as /dev/da4. But if I disconnect without unmounting the device, it detaches, but when plugged back in, it receives a new device as /dev/da5, which is not what is in fstab of course, yada, yada, yada. Is there a way I can get it to automatically mount/unmount the drive while working under the same device id as I unplug and plug back in? /dev/da4s1 /mnt/usbmsdos rw,noauto 0 0 Also, if I try to reboot after unplugging the device, I get a page fault error. Not sure where this error is in the logs so I can post here in my message. -- Robert ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Auto mount/unmount USB hard drive
On Mon, 08 May 2006 19:40:44 -0400 Robert Fitzpatrick [EMAIL PROTECTED] wrote: I have a USB hard drive mounting and working fine. I have the following entry in /etc/fstab that allows it to work on boot. The device loads as /dev/da4. But if I disconnect without unmounting the device, it detaches, but when plugged back in, it receives a new device as /dev/da5, which is not what is in fstab of course, yada, yada, yada. Is there a way I can get it to automatically mount/unmount the drive while working under the same device id as I unplug and plug back in? /dev/da4s1 /mnt/usbmsdos rw,noauto 0 0 If the msdosfs has a label, you could load geom_label.ko and use sth like /dev/msdosfs/usbdisk/mnt/usbmsdos rw,noauto 0 0 -- | /\ ASCII ribbon | GnuPG Key ID | e86d b753 3deb e749 6c3a | | \ / campaign against |0xbbcaad24 | 5706 1f7d 6cfd bbca ad24 | | XHTML in email |.the next sentence is true. | | / \ and news | .the previous sentence was a lie.| signature.asc Description: PGP signature
NFS/diskless: mount/unmount problems
Hi, I am trying to setup diskless workstations. I have got to the point where I can boot up the workstations, the nfs_root is mounted correctly read only. I have two problems with NFS: 1) The problem is mounting /var rw. I want to use an nfs mount to let data be persistent and since I don't have too much ram. If I nfs mount /var I get the following error: unable to update /var/db/mounttab This happens because mount tries to update the file before mounting the filesystem, and hence tries to write to the file on the root partition which is read-only. Mounting root in rw would probably remove the error, but it's not the desireable solution since mounttab become unavailable after the mount, and it adds the risk of inconsistencies on the root share. How, do I correct this error? Should I simply ignore? After the mount, things seems to work ok. 2) After mounting the /var and /home, I try to start up X. So far little luck, I need to configure X, but that's another story. The problem is on shutdown, the client fails to sync the disks before unmounting the nfs-partitions, it prints a secuence of non-zero digits untill giving up. I don't know if this too can be silently ignored. Thanks, Erik -- Ph: +34.666334818 web: www.locolomo.org S/MIME Certificate: http://www.locolomo.org/crt/2004071206.crt Subject ID: A9:76:7A:ED:06:95:2B:8D:48:97:CE:F2:3F:42:C8:F2:22:DE:4C:B9 Fingerprint: 4A:E8:63:38:46:F6:9A:5D:B4:DC:29:41:3F:62:D3:0A:73:25:67:C2 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]